From 666a1ea43c5b19501e77e2e8e9fb99ca7eca0714 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 10 Aug 2019 22:02:47 +1000 Subject: [PATCH] Make sure trigger_heal uses the .health field instead of a resource, since this is mapper defined --- qcsrc/common/mapobjects/trigger/counter.qc | 2 +- qcsrc/common/mapobjects/trigger/heal.qc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/mapobjects/trigger/counter.qc b/qcsrc/common/mapobjects/trigger/counter.qc index 9156439f99..db255ebb7a 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 94abd4041d..b110d9913f 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 == "") -- 2.39.2