]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
When manually moving to spectators reset caplayer in the mutator hook MakePlayerObserver
authorterencehill <piuntn@gmail.com>
Sat, 2 Mar 2013 13:09:57 +0000 (14:09 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 2 Mar 2013 22:04:05 +0000 (23:04 +0100)
qcsrc/server/cl_client.qc
qcsrc/server/mutators/gamemode_ca.qc

index a32fd6a1235a6973f104078e9317b1cf9247029a..8c922b2b288bc63849b3f85f637b3460569aacbb 100644 (file)
@@ -1046,14 +1046,13 @@ void ClientKill_Now_TeamChange()
        }
        else if(self.killindicator_teamchange == -2)
        {
-               if(g_ca)
-                       self.caplayer = 0;
                if(blockSpectators)
                        sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
                PutObserverInServer();
        }
        else
                SV_ChangeTeam(self.killindicator_teamchange - 1);
+       self.killindicator_teamchange = 0;
 }
 
 void ClientKill_Now()
index 0b47a2dd5284b8389a87dd5b0ca35acec4e82e5d..15ed4fa7117af4b19a4735a56612413fb051fb8f 100644 (file)
@@ -216,6 +216,8 @@ MUTATOR_HOOKFUNCTION(ca_ForbidPlayerScore_Clear)
 
 MUTATOR_HOOKFUNCTION(ca_MakePlayerObserver)
 {
+       if(self.killindicator_teamchange == -2)
+               self.caplayer = 0;
        if(self.caplayer)
                self.frags = FRAGS_LMS_LOSER;
        return 1;