]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_freezetag.qc
Add missing SELFPARAM()
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_freezetag.qc
index 7dd7e67c556afa418b5abb5baaea4154470560d7..4d7b8c9f9d47f14d8ffe284cfcb83499f7ad5d32 100644 (file)
@@ -1,3 +1,4 @@
+#include "gamemode_freezetag.qh"
 #ifndef GAMEMODE_FREEZETAG_H
 #define GAMEMODE_FREEZETAG_H
 
@@ -98,14 +99,14 @@ float freezetag_CheckTeams()
        if(FREEZETAG_ALIVE_TEAMS_OK())
        {
                if(prev_missing_teams_mask > 0)
-                       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS);
+                       Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
                prev_missing_teams_mask = -1;
                return 1;
        }
        if(total_players == 0)
        {
                if(prev_missing_teams_mask > 0)
-                       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS);
+                       Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
                prev_missing_teams_mask = -1;
                return 0;
        }
@@ -165,8 +166,8 @@ float freezetag_CheckWinner()
        int winner_team = freezetag_getWinnerTeam();
        if(winner_team > 0)
        {
-               Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM_4(winner_team, CENTER_ROUND_TEAM_WIN_));
-               Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(winner_team, INFO_ROUND_TEAM_WIN_));
+               Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
+               Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
                TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
        }
        else if(winner_team == -1)
@@ -376,12 +377,13 @@ MUTATOR_HOOKFUNCTION(ft, MakePlayerObserver)
 }
 
 MUTATOR_HOOKFUNCTION(ft, PlayerDies)
-{SELFPARAM();
+{
+    SELFPARAM();
        if(round_handler_IsActive())
        if(round_handler_CountdownRunning())
        {
-               if(STAT(FROZEN, self))
-                       freezetag_Unfreeze(world);
+               if(STAT(FROZEN, frag_target))
+                       WITH(entity, self, frag_target, freezetag_Unfreeze(world));
                freezetag_count_alive_players();
                return 1; // let the player die so that he can respawn whenever he wants
        }
@@ -392,23 +394,23 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies)
                || frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
        {
                // let the player die, he will be automatically frozen when he respawns
-               if(STAT(FROZEN, self) != 1)
+               if(STAT(FROZEN, frag_target) != 1)
                {
                        freezetag_Add_Score(frag_attacker);
                        freezetag_count_alive_players();
                        freezetag_LastPlayerForTeam_Notify();
                }
                else
-                       freezetag_Unfreeze(world); // remove ice
-               self.health = 0; // Unfreeze resets health
-               self.freezetag_frozen_timeout = -2; // freeze on respawn
+                       WITH(entity, self, frag_target, freezetag_Unfreeze(world)); // remove ice
+               frag_target.health = 0; // Unfreeze resets health
+               frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
                return 1;
        }
 
-       if(STAT(FROZEN, self))
+       if(STAT(FROZEN, frag_target))
                return 1;
 
-       freezetag_Freeze(frag_attacker);
+       WITH(entity, self, frag_target, freezetag_Freeze(frag_attacker));
        freezetag_LastPlayerForTeam_Notify();
 
        if(frag_attacker == frag_target || frag_attacker == world)