]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc
Purge SetResourceAmountExplicit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / vampirehook / sv_vampirehook.qc
index 319b518665fff22505ba0afaf5256187257b443c..5e090d394802fb3a37e401a7822ad889d594c249 100644 (file)
@@ -27,10 +27,10 @@ MUTATOR_HOOKFUNCTION(vh, GrappleHookThink)
                thehook.last_dmg = time + autocvar_g_vampirehook_damagerate;
                thehook.owner.damage_dealt += autocvar_g_vampirehook_damage;
                Damage(dmgent, thehook, thehook.owner, autocvar_g_vampirehook_damage, WEP_HOOK.m_id, DMG_NOWEP, thehook.origin, '0 0 0');
-               if(SAME_TEAM(thehook.owner, thehook.aiment))
-                       GiveResourceWithLimit(thehook.aiment, RESOURCE_HEALTH, autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
-               else
-                       GiveResourceWithLimit(thehook.owner, RESOURCE_HEALTH, autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
+               entity targ = ((SAME_TEAM(thehook.owner, thehook.aiment)) ? thehook.aiment : thehook.owner);
+               // TODO: we can't do this due to an issue with globals and the mutator arguments
+               //Heal(targ, thehook.owner, autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
+               SetResourceAmount(targ, RESOURCE_HEALTH, min(GetResourceAmount(targ, RESOURCE_HEALTH) + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max));
 
                if(dmgent == thehook.owner)
                        TakeResource(dmgent, RESOURCE_HEALTH, autocvar_g_vampirehook_damage); // FIXME: friendly fire?!