]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Properly limit the teams a player can join
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 19 Mar 2017 08:30:08 +0000 (08:30 +0000)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 19 Mar 2017 08:30:08 +0000 (08:30 +0000)
qcsrc/server/mutators/mutator/gamemode_singleplayer.qc

index c7ba657dc77835d988ad82e7e5f96a42135d4eac..b0b9f07f4f36c44225d69448c2582184e81ca4c6 100644 (file)
@@ -71,9 +71,13 @@ MUTATOR_HOOKFUNCTION(sp, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
     {
         ent.team_forced = NUM_TEAM_2;
     }
-    else if( IS_PLAYER(ent) )
+    else if( IS_REAL_CLIENT(ent) )
     {
         ent.team_forced = NUM_TEAM_1;
+        c1 = 1;
+        c2 = 0;
+        c3 = 0;
+        c4 = 0;
     }
     return true;
 }
@@ -85,8 +89,8 @@ MUTATOR_HOOKFUNCTION(sp, Scores_CountFragsRemaining)
 
 MUTATOR_HOOKFUNCTION(sp, PlayerSpawn)
 {
-       entity player = M_ARGV(0, entity);
-       entity spawn_spot = M_ARGV(1, entity);
+    entity player = M_ARGV(0, entity);
+    entity spawn_spot = M_ARGV(1, entity);
     if ( IS_BOT_CLIENT(player) )
     {
         player.can_drop_weapon = spawn_spot.can_drop_weapon;