From: Mario Date: Sat, 21 Jul 2018 07:04:59 +0000 (+1000) Subject: Use the old method for setting health in hook code to avoid calling mutator hooks X-Git-Tag: xonotic-v0.8.5~1951 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4ec83e78f5b2db35cfb04027a7205e0f393d78a0;p=xonotic%2Fxonotic-data.pk3dir.git Use the old method for setting health in hook code to avoid calling mutator hooks --- diff --git a/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc b/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc index 115e6ca91..e74cfb115 100644 --- a/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc +++ b/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc @@ -28,7 +28,9 @@ MUTATOR_HOOKFUNCTION(vh, GrappleHookThink) 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'); entity targ = ((SAME_TEAM(thehook.owner, thehook.aiment)) ? thehook.aiment : thehook.owner); - Heal(targ, thehook.owner, autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max); + // 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); + SetResourceAmountExplicit(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?!