]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Arena: centerprint "Waiting for players to join..." when alone in the server
authorterencehill <piuntn@gmail.com>
Wed, 2 Jan 2013 08:52:12 +0000 (09:52 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 2 Jan 2013 08:52:12 +0000 (09:52 +0100)
qcsrc/server/mutators/gamemode_arena.qc

index 86f449a7361bb1030dad4cc552e4b97930d2ca8e..352f342f7b73b4c8b4d94a09def7b6f7a62819be 100644 (file)
@@ -108,12 +108,30 @@ void Arena_AddChallengers()
        self = e;
 }
 
+float prev_numspawned;
 float Arena_CheckPlayers()
 {
+       entity e;
+
        Arena_AddChallengers();
 
        if(numspawned >= 2)
+       {
+               if(prev_numspawned != -1)
+               {
+                       FOR_EACH_REALCLIENT(e)
+                               Send_CSQC_Centerprint_Generic_Expire(e, CPID_WAITING_PLAYERS);
+               }
+               prev_numspawned = -1;
                return 1;
+       }
+
+       if(prev_numspawned != numspawned && numspawned == 1)
+       {
+               FOR_EACH_REALCLIENT(e)
+                       Send_CSQC_Centerprint_Generic(e, CPID_WAITING_PLAYERS, "Waiting for players to join...", -1, 0);
+               prev_numspawned = numspawned;
+       }
 
        return 0;
 }