]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_keyhunt.qc
Merge remote-tracking branch 'origin/master' into samual/fix_deathfade
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_keyhunt.qc
index 97d2dcd47936d8706973f5d495cab87ea6e88adc..99e7a3eae1cfd5666505e32237180d6d08549bf0 100644 (file)
@@ -69,7 +69,7 @@ float kh_key_dropped, kh_key_carried;
 
 float kh_KeyCarrier_waypointsprite_visible_for_player(entity e)  // runs all the time
 {
-       if(e.classname != "player" || self.team != e.team)
+       if(!IS_PLAYER(e) || self.team != e.team)
                if(!kh_tracking_enabled)
                        return FALSE;
 
@@ -391,7 +391,7 @@ void kh_Key_Damage(entity inflictor, entity attacker, float damage, float deatht
        if(vlen(force) <= 0)
                return;
        if(time > self.pushltime)
-               if(attacker.classname == "player")
+               if(IS_PLAYER(attacker))
                        self.team = attacker.team;
 }
 
@@ -426,7 +426,7 @@ void kh_Key_Touch()  // runs many, many times when a key has been dropped and ca
                // maybe start a shorter countdown?
        }
 
-       if(other.classname != "player")
+       if not(IS_PLAYER(other))
                return;
        if(other.deadflag != DEAD_NO)
                return;
@@ -479,7 +479,7 @@ void kh_FinishRound()  // runs when a team captures the keys
                kh_Key_Remove(key);
        kh_no_radar_circles = FALSE;
 
-       Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ARENA_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
+       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);
 }
 
@@ -555,7 +555,7 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
        attacker = world;
        if(lostkey.pusher)
                if(lostkey.pusher.team != teem)
-                       if(lostkey.pusher.classname == "player")
+                       if(IS_PLAYER(lostkey.pusher))
                                attacker = lostkey.pusher;
 
        players = keys = 0;
@@ -857,7 +857,7 @@ void kh_WaitForPlayers()  // delay start of the round until enough players are p
        float p1 = kh_CheckPlayers(0), p2 = kh_CheckPlayers(1), p3 = kh_CheckPlayers(2), p4 = kh_CheckPlayers(3);
        if not(p1 || p2 || p3 || p4)
        {
-               Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ARENA_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
+               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);
        }
        else
@@ -1012,7 +1012,7 @@ MUTATOR_HOOKFUNCTION(kh_PlayerDies)
 {
        if(self == other)
                kh_Key_DropAll(self, TRUE);
-       else if(other.classname == "player")
+       else if(IS_PLAYER(other))
                kh_Key_DropAll(self, FALSE);
        else
                kh_Key_DropAll(self, TRUE);