void counter_use(entity this, entity actor, entity trigger)
{
entity store = this;
- if(this.spawnflags & COUNTER_PER_PLAYER)
+ if(this.spawnflags & COUNTER_PER_PLAYER) // FIXME: multiple counters in the map will not function correctly, and upon trigger reset the player won't be able to use it again!
{
if(!IS_PLAYER(actor))
return;
toucher.triggerhealtime = time + this.delay;
bool playthesound = (this.spawnflags & HEAL_SOUND_ALWAYS);
- bool healed = Heal(toucher, this, GetResource(this, RES_HEALTH), this.max_health);
+ bool healed = Heal(toucher, this, this.health, this.max_health);
if(playthesound || healed)
_sound (toucher, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
this.active = ACTIVE_ACTIVE;
if(!this.delay)
this.delay = 1;
- if(!GetResource(this, RES_HEALTH))
- SetResourceExplicit(this, RES_HEALTH, 10); // TODO: use a special field for this, it doesn't have actual health!
+ if(!this.health)
+ this.health = 10;
if(!this.max_health)
this.max_health = 200; // max health topoff for field
if(this.noise == "")