From: Mario Date: Thu, 29 Aug 2013 15:29:04 +0000 (+1000) Subject: Remove attached hooks when the player freezes/unfreezes X-Git-Tag: xonotic-v0.8.0~241^2^2~134 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=2d3e45d367e1844ce021917be679097dcf261d18;p=xonotic%2Fxonotic-data.pk3dir.git Remove attached hooks when the player freezes/unfreezes --- diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 56cac627f..adb032ccd 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -563,7 +563,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo targ.health = 1; targ.revive_speed = freeze_time; - entity ice; + entity ice, head; ice = spawn(); ice.owner = targ; ice.classname = "ice"; @@ -585,6 +585,10 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo RemoveGrapplingHook(targ); + FOR_EACH_PLAYER(head) + if(head.hook.aiment == targ) + RemoveGrapplingHook(head); + // add waypoint if(show_waypoint) WaypointSprite_Spawn("frozen", 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, TRUE, RADARICON_WAYPOINT, '0.25 0.90 1'); @@ -594,17 +598,21 @@ void Unfreeze (entity targ) { if(targ.frozen) // only reset health if target was frozen targ.health = ((IS_PLAYER(targ)) ? autocvar_g_balance_health_start : targ.max_health); + + entity head; targ.frozen = 0; targ.revive_progress = 0; WaypointSprite_Kill(targ.waypointsprite_attached); + + FOR_EACH_PLAYER(head) + if(head.hook.aiment == targ) + RemoveGrapplingHook(head); // remove the ice block if(targ.iceblock) - { remove(targ.iceblock); - targ.iceblock = world; - } + targ.iceblock = world; } // these are updated by each Damage call for use in button triggering and such @@ -743,7 +751,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float frag_target = targ; frag_damage = damage; frag_force = force; - frag_deathtype = deathtype; + frag_deathtype = deathtype; frag_mirrordamage = mirrordamage; MUTATOR_CALLHOOK(PlayerDamage_Calculate); damage = frag_damage;