From: Mario Date: Thu, 1 Feb 2018 17:00:29 +0000 (+1000) Subject: Give trigger_heal a spawnflag to always play the healing sound when activated, regard... X-Git-Tag: xonotic-v0.8.5~2359 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ebca408c270bda61a8bee4d4fc6aa8c7d79310e5;p=xonotic%2Fxonotic-data.pk3dir.git Give trigger_heal a spawnflag to always play the healing sound when activated, regardless of whether player actually gained health from it --- diff --git a/qcsrc/common/triggers/trigger/heal.qc b/qcsrc/common/triggers/trigger/heal.qc index 4447ea21e..1f63a5a53 100644 --- a/qcsrc/common/triggers/trigger/heal.qc +++ b/qcsrc/common/triggers/trigger/heal.qc @@ -18,12 +18,16 @@ void trigger_heal_touch(entity this, entity toucher) EXACTTRIGGER_TOUCH(this, toucher); toucher.triggerhealtime = time + 1; + bool playthesound = (this.spawnflags & 4); if (toucher.health < this.max_health) { + playthesound = true; toucher.health = min(toucher.health + this.health, this.max_health); toucher.pauserothealth_finished = max(toucher.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot); - _sound (toucher, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM); } + + if(playthesound) + _sound (toucher, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM); } } }