if(STAT(FROZEN, targ))
return;
- targ.freezetag_frozen_armor = GetResource(targ, RES_ARMOR);
-
targ.freezetag_frozen_time = time;
if (autocvar_g_freezetag_revive_auto && autocvar_g_freezetag_frozen_maxtime > 0)
targ.freezetag_frozen_timeout = time + autocvar_g_freezetag_frozen_maxtime;
frag_target.respawn_time = time + 1;
frag_target.respawn_flags |= RESPAWN_FORCE;
- // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe
- // you succeed changing team through the menu: you both really die (gibbing) and get frozen
- if(ITEM_DAMAGE_NEEDKILL(frag_deathtype)
- || frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
+ // let the player die, they will be automatically frozen when they respawn
+ // it fixes a bug where you both really die (gibbing) and get frozen
+ // if you succeed changing team through the menu
+ if (frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
{
- // let the player die, they will be automatically frozen when they respawn
- if (STAT(FROZEN, frag_target) != FROZEN_NORMAL)
- {
- freezetag_Add_Score(frag_target, frag_attacker);
- freezetag_count_alive_players();
- freezetag_LastPlayerForTeam_Notify(frag_target);
- frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
- }
- else
- {
- // soft-kill: setting health to something >= 1 after death, ammo won't be reset
- SetResourceExplicit(frag_target, RES_HEALTH, 1);
- // restore armor as it was removed in PlayerDamage
- SetResourceExplicit(frag_target, RES_ARMOR, frag_target.freezetag_frozen_armor);
-
- // relocate
- entity spot = SelectSpawnPoint(frag_target, true);
- setorigin(frag_target, spot.origin);
- frag_target.oldorigin = frag_target.origin;
- frag_target.fixangle = true; // turn this way immediately
- frag_target.angles = vec2(spot.angles);
- frag_target.velocity = '0 0 0';
- frag_target.oldvelocity = frag_target.velocity; // prevents fall damage, see CreatureFrame_FallDamage
- frag_target.avelocity = '0 0 0';
- frag_target.punchangle = '0 0 0';
- frag_target.punchvector = '0 0 0';
- }
+ freezetag_Add_Score(frag_target, frag_attacker);
+ freezetag_count_alive_players();
+ freezetag_LastPlayerForTeam_Notify(frag_target);
+ frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
return true;
}
+ if(ITEM_DAMAGE_NEEDKILL(frag_deathtype))
+ {
+ // soft-kill: setting health to something >= 1 after death, ammo won't be reset
+ SetResourceExplicit(frag_target, RES_HEALTH, 1);
+ // restore armor as it was removed in PlayerDamage
+ SetResourceExplicit(frag_target, RES_ARMOR, frag_target.freezetag_frozen_armor);
+
+ // relocate
+ entity spot = SelectSpawnPoint(frag_target, true);
+ setorigin(frag_target, spot.origin);
+ frag_target.oldorigin = frag_target.origin;
+ frag_target.fixangle = true; // turn this way immediately
+ frag_target.angles = vec2(spot.angles);
+ frag_target.velocity = '0 0 0';
+ frag_target.oldvelocity = frag_target.velocity; // prevents fall damage, see CreatureFrame_FallDamage
+ frag_target.avelocity = '0 0 0';
+ frag_target.punchangle = '0 0 0';
+ frag_target.punchvector = '0 0 0';
+ }
+
if (STAT(FROZEN, frag_target) == FROZEN_NORMAL)
return true;
//float frag_damage = M_ARGV(4, float);
vector frag_force = M_ARGV(6, vector);
+ frag_target.freezetag_frozen_armor = GetResource(frag_target, RES_ARMOR);
+
if (STAT(FROZEN, frag_target) == FROZEN_NORMAL && autocvar_g_freezetag_revive_auto_reducible
&& autocvar_g_freezetag_frozen_maxtime > 0 && autocvar_g_freezetag_revive_auto)
{