]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give trigger_heal a spawnflag to always play the healing sound when activated, regard...
authorMario <mario@smbclan.net>
Thu, 1 Feb 2018 17:00:29 +0000 (03:00 +1000)
committerMario <mario@smbclan.net>
Thu, 1 Feb 2018 17:00:29 +0000 (03:00 +1000)
qcsrc/common/triggers/trigger/heal.qc

index 4447ea21e25f0cf7928378fc97a462eb004c2b05..1f63a5a5388fe8a4d38035bcb076d0ed156d3a7f 100644 (file)
@@ -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);
                }
        }
 }