}
void ClientKill_Now_TeamChange();
-void freezetag_CheckWinner();
void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
if(accuracy_isgooddamage(attacker, self))
attacker.accuracy.(accuracy_frags[w-1]) += 1;
- if(deathtype == DEATH_HURTTRIGGER && g_freezetag)
- {
- PutClientInServer();
- count_alive_players(); // re-count players
- freezetag_CheckWinner();
- return;
- }
-
frag_attacker = attacker;
frag_inflictor = inflictor;
frag_target = self;
- MUTATOR_CALLHOOK(PlayerDies);
+ frag_deathtype = deathtype;
+ if (MUTATOR_CALLHOOK(PlayerDies))
+ return;
+
weapon_action(self.weapon, WR_PLAYERDEATH);
RemoveGrapplingHook(self);
MUTATOR_HOOKABLE(PlayerDies);
// called when a player dies to e.g. remove stuff he was carrying.
+ // return 1 to skip death animation, gibs and such (e.g. if player must respawn immediately)
// INPUT:
entity frag_inflictor;
entity frag_attacker;
entity frag_target; // same as self
+ float frag_deathtype;
MUTATOR_HOOKABLE(GiveFragsForKill);
// called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill
MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
{
+
+ if(frag_deathtype == DEATH_HURTTRIGGER)
+ {
+ if(!self.freezetag_frozen)
+ {
+ freezetag_remove_alive();
+ freezetag_CheckWinner();
+ }
+ PutClientInServer(); // respawn the player
+ self.health = 1;
+ return 1;
+ }
+
if(self.freezetag_frozen == 0)
{
freezetag_Freeze(frag_attacker);
freezetag_CheckWinner();
- return 1;
+ return 0;
}
MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
skill = autocvar_skill;
count_players();
- if(g_ca || g_freezetag)
+ if(g_ca)
count_alive_players();
Arena_Warmup();
Spawnqueue_Check();
if(game_delay_last == TRUE)
if(game_delay == FALSE)
if(autocvar_sv_eventlog)
- GameLogEcho(":startdelay_ended");
+ GameLogEcho(":startdelay_ended");
game_delay_last = game_delay;