From: Mario Date: Sat, 10 Aug 2019 12:02:47 +0000 (+1000) Subject: Make sure trigger_heal uses the .health field instead of a resource, since this is... X-Git-Tag: xonotic-v0.8.5~1422 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=666a1ea43c5b19501e77e2e8e9fb99ca7eca0714;p=xonotic%2Fxonotic-data.pk3dir.git Make sure trigger_heal uses the .health field instead of a resource, since this is mapper defined --- diff --git a/qcsrc/common/mapobjects/trigger/counter.qc b/qcsrc/common/mapobjects/trigger/counter.qc index 9156439f9..db255ebb7 100644 --- a/qcsrc/common/mapobjects/trigger/counter.qc +++ b/qcsrc/common/mapobjects/trigger/counter.qc @@ -5,7 +5,7 @@ void counter_reset(entity this); 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; diff --git a/qcsrc/common/mapobjects/trigger/heal.qc b/qcsrc/common/mapobjects/trigger/heal.qc index 94abd4041..b110d9913 100644 --- a/qcsrc/common/mapobjects/trigger/heal.qc +++ b/qcsrc/common/mapobjects/trigger/heal.qc @@ -18,7 +18,7 @@ void trigger_heal_touch(entity this, entity toucher) 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); @@ -36,8 +36,8 @@ void trigger_heal_init(entity this) 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 == "")