]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
Use macros for labels
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_keyhunt.qc
index dc34e08eca145a14dd1817996ab0b132889f60fc..d1316d2883b64fbf5ff6c672e25700c9c00170c0 100644 (file)
@@ -1,3 +1,4 @@
+#include "gamemode_keyhunt.qh"
 #ifndef GAMEMODE_KEYHUNT_H
 #define GAMEMODE_KEYHUNT_H
 
@@ -759,7 +760,7 @@ void kh_Key_Think()  // runs all the time
                        if(vlen(key.owner.origin - p) > autocvar_g_balance_keyhunt_maxdist)
                                goto not_winning;
                kh_WinnerTeam(self.team);
-:not_winning
+LABEL(not_winning)
        }
 
        if(kh_interferemsg_time && time > kh_interferemsg_time)
@@ -919,7 +920,7 @@ float kh_CheckPlayers(float num)
                float t_team = kh_Team_ByID(num);
                float players = 0;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == t_team)
+                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == t_team)
                                ++players;
                ));
 
@@ -943,7 +944,7 @@ void kh_WaitForPlayers()  // delay start of the round until enough players are p
        if(KH_READY_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;
                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
                kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
@@ -953,7 +954,7 @@ void kh_WaitForPlayers()  // delay start of the round until enough players are p
                if(player_count == 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;
                }
                else
@@ -973,8 +974,8 @@ void kh_WaitForPlayers()  // delay start of the round until enough players are p
 
 void kh_EnableTrackingDevice()  // runs after each round
 {
-       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT);
-       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT_OTHER);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT_OTHER);
 
        kh_tracking_enabled = true;
 }
@@ -996,8 +997,8 @@ void kh_StartRound()  // runs at the start of each round
                return;
        }
 
-       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT);
-       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT_OTHER);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT_OTHER);
 
        for(i = 0; i < kh_teams; ++i)
        {
@@ -1005,7 +1006,7 @@ void kh_StartRound()  // runs at the start of each round
                players = 0;
                entity my_player = world;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == teem)
+                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem)
                        {
                                ++players;
                                if(random() * players <= 1)
@@ -1352,6 +1353,7 @@ MUTATOR_HOOKFUNCTION(kh, PlayerUseKey)
 
 MUTATOR_HOOKFUNCTION(kh, HavocBot_ChooseRole)
 {
+    SELFPARAM();
        if(IS_DEAD(self))
                return true;