]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Autofail when timelimit expires. Doesn't affect untimed levels.
authorThePWTULN <matthew@home.(none)>
Fri, 27 Aug 2010 11:15:10 +0000 (12:15 +0100)
committerThePWTULN <matthew@home.(none)>
Fri, 27 Aug 2010 11:15:10 +0000 (12:15 +0100)
qcsrc/server/campaign.qc

index 8d8e18587e490164dad02b58f55f9bfe6e57567b..300d01a7a56607b031a28e5e0d419c2dbadd42ea 100644 (file)
@@ -188,8 +188,23 @@ void CampaignPreIntermission()
 
        if(won == 1 && lost == 0 && checkrules_equality == 0 && cheatcount_total == 0)
        {
+               if(cvar("timelimit") != 0  &&  time > cvar("timelimit") * 60) // checks if the timelimit has expired.
+               {
+                       campaign_won = 0;
+                       bprint("Time's up! The current level has been LOST.\n");
+                       // sound!
+               }
+               else
+               {
                campaign_won = 1;
                bprint("The current level has been WON.\n");
+               // sound!       
+               }
+       }
+       else if(cvar("timelimit") != 0  &&  time > cvar("timelimit") * 60)
+       {
+               campaign_won = 0;
+               bprint("Time's up! The current level has been LOST.\n");
                // sound!
        }
        else