]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/heal.qc
Use Heal in more places (turrets, trigger_heal, mage, bumblebee, vampirehook)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / heal.qc
index 61f27a0219184340edfeca6bd40a3f7d6ac46156..fb20ebdbadbbd45c45edd73e0b3e93723cb2580c 100644 (file)
@@ -18,14 +18,9 @@ void trigger_heal_touch(entity this, entity toucher)
                                toucher.triggerhealtime = time + this.delay;
 
                        bool playthesound = (this.spawnflags & HEAL_SOUND_ALWAYS);
-                       if (GetResourceAmount(toucher, RESOURCE_HEALTH) < this.max_health)
-                       {
-                               playthesound = true;
-                               GiveResourceWithLimit(toucher, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH), this.max_health);
-                               toucher.pauserothealth_finished = max(toucher.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
-                       }
+                       bool healed = Heal(toucher, this, GetResourceAmount(this, RESOURCE_HEALTH), this.max_health);
 
-                       if(playthesound)
+                       if(playthesound || healed)
                                _sound (toucher, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
                }
        }