]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Temporary hack to give bots lives
authorMario <mario.mario@y7mail.com>
Wed, 6 Feb 2013 23:49:28 +0000 (10:49 +1100)
committerMario <mario.mario@y7mail.com>
Wed, 6 Feb 2013 23:49:28 +0000 (10:49 +1100)
qcsrc/server/mutators/gamemode_lms.qc

index 1e9db0e7dac7c11853a6dd1fee6e0bb086c35a25..be84a517cac9ffdb05d556f894a9eec608521251 100644 (file)
@@ -114,6 +114,18 @@ MUTATOR_HOOKFUNCTION(lms_FilterItem)
        return TRUE;
 }
 
+MUTATOR_HOOKFUNCTION(lms_BotSpawn)
+{
+       // temporary hack to give bots lives
+       if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
+       {
+               PlayerScore_Add(self, SP_LMS_RANK, 666);
+               self.frags = FRAGS_SPECTATOR;
+       }
+       
+       return FALSE;
+}      
+
 // scoreboard stuff
 void lms_ScoreRules()
 {
@@ -142,6 +154,7 @@ MUTATOR_DEFINITION(gamemode_lms)
        MUTATOR_HOOK(SetStartItems, lms_SetStartItems, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerClearScore, lms_KeepScore, CBC_ORDER_ANY);
        MUTATOR_HOOK(FilterItem, lms_FilterItem, CBC_ORDER_ANY);
+       MUTATOR_HOOK(HavocBot_ChooseRule, lms_BotSpawn, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {