X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fvampirehook%2Fsv_vampirehook.qc;h=5e090d394802fb3a37e401a7822ad889d594c249;hb=refs%2Fmerge-requests%2F636%2Fhead;hp=ce9e270654cb498281e01db990aa652e0ae8f8c1;hpb=678127044857fb9b89f06faf7a3313bdeb43205c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc b/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc index ce9e270654..5e090d3948 100644 --- a/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc +++ b/qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc @@ -21,18 +21,18 @@ MUTATOR_HOOKFUNCTION(vh, GrappleHookThink) if(!STAT(FROZEN, thehook.aiment)) if(time >= game_starttime) if(DIFF_TEAM(thehook.owner, thehook.aiment) || autocvar_g_vampirehook_teamheal) - if(thehook.aiment.health > 0) + if(GetResourceAmount(thehook.aiment, RESOURCE_HEALTH) > 0) if(autocvar_g_vampirehook_damage) { 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, thehook.origin, '0 0 0'); - if(SAME_TEAM(thehook.owner, thehook.aiment)) - thehook.aiment.health = min(thehook.aiment.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max); - else - thehook.owner.health = min(thehook.owner.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max); + 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); + // 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) - dmgent.health -= autocvar_g_vampirehook_damage; // FIXME: friendly fire?! + TakeResource(dmgent, RESOURCE_HEALTH, autocvar_g_vampirehook_damage); // FIXME: friendly fire?! } }