]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Cleanup: replace a few checks with the macro IS_PLAYER
authorterencehill <piuntn@gmail.com>
Sat, 9 Mar 2013 23:18:52 +0000 (00:18 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 9 Mar 2013 23:47:13 +0000 (00:47 +0100)
qcsrc/server/command/vote.qc
qcsrc/server/mutators/gamemode_arena.qc
qcsrc/server/mutators/gamemode_freezetag.qc

index a296c7a1d41b7517376bf76401474568c6411040..ad0fb795a1f20667cf91e668656b22f922a5a270 100644 (file)
@@ -377,7 +377,7 @@ void reset_map(float dorespawn)
                if (restart_mapalreadyrestarted || (time < game_starttime))
                {
                        //NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
-                       if (self.classname == "player") {
+                       if (IS_PLAYER(self)) {
                                //PlayerScore_Clear(self);
                                if(g_lms)
                                        PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
@@ -492,7 +492,7 @@ void ReadyCount()
 
        FOR_EACH_REALCLIENT(tmp_player)
        {
-               if(tmp_player.classname == "player" || tmp_player.caplayer == 1)
+               if(IS_PLAYER(tmp_player) || tmp_player.caplayer == 1)
                {
                        ++t_players;
                        if(tmp_player.ready) { ++t_ready; }
index 0410eb2fb2a28fb678af93cc2bc5f29f37cb8421..92c5fd6142944e7368008271cb0077550d867930 100644 (file)
@@ -75,7 +75,7 @@ float Arena_CheckWinner()
        champion = world;
        FOR_EACH_CLIENT(e)
        {
-               if(e.spawned && e.classname == "player")
+               if(e.spawned && IS_PLAYER(e))
                        champion = e;
        }
 
index 2c3ab37b0410f01052ff3e499a2192353ad112f8..6ba51a0b90776400c3951f46477c6876d0e9846f 100644 (file)
@@ -145,7 +145,7 @@ void freezetag_Add_Score(entity attacker)
                // counted as "suicide" already
                PlayerScore_Add(self, SP_SCORE, -1);
        }
-       else if(attacker.classname == "player")
+       else if(IS_PLAYER(attacker))
        {
                // got frozen by an enemy
                // counted as "kill" and "death" already