]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/mage.qc
Merge branch 'master' into martin-t/dmgtext
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / mage.qc
index cbc6c5f062044e1c637e00336b55ecf48e539e8d..88120a0ea7550acbb93cd46e9b94022165b18ba2 100644 (file)
@@ -234,9 +234,11 @@ void M_Mage_Defend_Heal(entity this)
                        switch(this.skin)
                        {
                                case 0:
-                                       GiveResourceWithLimit(it, RESOURCE_HEALTH, autocvar_g_monster_mage_heal_allies, autocvar_g_balance_health_regenstable);
+                               {
+                                       Heal(it, this, autocvar_g_monster_mage_heal_allies, autocvar_g_balance_health_regenstable);
                                        fx = EFFECT_HEALING;
                                        break;
+                               }
                                case 1:
                                {
                                        if(GetResourceAmount(this, RESOURCE_CELLS)) GiveResourceWithLimit(it, RESOURCE_CELLS, 1, g_pickup_cells_max);
@@ -257,7 +259,7 @@ void M_Mage_Defend_Heal(entity this)
                                        break;
                                case 3:
                                        float hp = ((it == this) ? autocvar_g_monster_mage_heal_self : autocvar_g_monster_mage_heal_allies);
-                                       SetResourceAmount(it, RESOURCE_HEALTH, GetResourceAmount(it, RESOURCE_HEALTH) - hp); // TODO: use regular damage functions? needs a way to bypass friendly fire checks
+                                       TakeResource(it, RESOURCE_HEALTH, hp); // TODO: use regular damage functions? needs a way to bypass friendly fire checks
                                        fx = EFFECT_RAGE;
                                        break;
                        }
@@ -267,7 +269,7 @@ void M_Mage_Defend_Heal(entity this)
                else
                {
                        Send_Effect(EFFECT_HEALING, it.origin, '0 0 0', 1);
-                       GiveResourceWithLimit(it, RESOURCE_HEALTH, autocvar_g_monster_mage_heal_allies, it.max_health);
+                       Heal(it, this, autocvar_g_monster_mage_heal_allies, RESOURCE_LIMIT_NONE);
                        if(!(it.spawnflags & MONSTERFLAG_INVINCIBLE) && it.sprite)
                                WaypointSprite_UpdateHealth(it.sprite, GetResourceAmount(it, RESOURCE_HEALTH));
                }