]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nades/nades.qc
URS: Added GiveResourceWithLimit.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nades / nades.qc
index d667c0cbf42a80a85b36498812bc2d048618914b..0c446952d033a60d14a52f83c4c2784cb1eaaf00 100644 (file)
@@ -626,11 +626,12 @@ void nade_heal_touch(entity this, entity toucher)
                        float hp = GetResourceAmount(toucher, RESOURCE_HEALTH);
                        if (hp < maxhealth)
                        {
-                               if ( this.nade_show_particles )
+                               if (this.nade_show_particles)
+                               {
                                        Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1);
-                               SetResourceAmount(toucher, RESOURCE_HEALTH, min(hp + health_factor, maxhealth));
+                               }
+                               GiveResourceWithLimit(toucher, RESOURCE_HEALTH, health_factor, maxhealth);
                        }
-                       toucher.pauserothealth_finished = max(toucher.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
                }
                else if ( health_factor < 0 )
                {