]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give players new lives when spawning, rather than on connect (fixes bots with no...
authorMario <mario.mario@y7mail.com>
Wed, 6 Feb 2013 23:27:59 +0000 (10:27 +1100)
committerMario <mario.mario@y7mail.com>
Wed, 6 Feb 2013 23:27:59 +0000 (10:27 +1100)
qcsrc/server/mutators/gamemode_lms.qc

index 1e9db0e7dac7c11853a6dd1fee6e0bb086c35a25..1e64c86bbf5f5d556677f57db6837c33a3edb4e1 100644 (file)
@@ -31,6 +31,12 @@ MUTATOR_HOOKFUNCTION(lms_RemovePlayer)
 
 MUTATOR_HOOKFUNCTION(lms_PlayerSpawn)
 {
+       if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
+       {
+               PlayerScore_Add(self, SP_LMS_RANK, 666);
+               self.frags = FRAGS_SPECTATOR;
+       }
+       
        // player is dead and becomes observer
        // FIXME fix LMS scoring for new system
        if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
@@ -43,12 +49,6 @@ MUTATOR_HOOKFUNCTION(lms_ClientConnect)
 {
        self.classname = "player";
        campaign_bots_may_start = 1;
-       
-       if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
-       {
-               PlayerScore_Add(self, SP_LMS_RANK, 666);
-               self.frags = FRAGS_SPECTATOR;
-       }
                        
        return FALSE;
 }