]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Gameover check is not needed in matchend hook
authorSamual <samual@xonotic.org>
Mon, 2 Apr 2012 15:51:57 +0000 (11:51 -0400)
committerSamual <samual@xonotic.org>
Mon, 2 Apr 2012 15:51:57 +0000 (11:51 -0400)
qcsrc/server/mutators/gamemode_ctf.qc

index 8613cecbacb8c5de600711d3eabcc16be69e727f..7a905a0b73b381db414c99cbbd55679754796d0b 100644 (file)
@@ -1112,32 +1112,29 @@ MUTATOR_HOOKFUNCTION(ctf_MatchEnd)
 {
        entity flag; // temporary entity for the search method
        
-       if(gameover) // is this necessary?
+       for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
        {
-               for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
+               switch(flag.ctf_status)
                {
-                       switch(flag.ctf_status)
+                       case FLAG_DROPPED:
+                       case FLAG_PASSING:
                        {
-                               case FLAG_DROPPED:
-                               case FLAG_PASSING:
-                               {
-                                       // lock the flag, game is over
-                                       flag.movetype = MOVETYPE_NONE;
-                                       flag.takedamage = DAMAGE_NO;
-                                       flag.solid = SOLID_NOT;
-                                       flag.nextthink = 0; // stop thinking
-                                       
-                                       print("stopping the ", flag.netname, " from moving.\n");
-                                       break;
-                               }
+                               // lock the flag, game is over
+                               flag.movetype = MOVETYPE_NONE;
+                               flag.takedamage = DAMAGE_NO;
+                               flag.solid = SOLID_NOT;
+                               flag.nextthink = 0; // stop thinking
                                
-                               default:
-                               case FLAG_BASE:
-                               case FLAG_CARRY:
-                               {
-                                       // do nothing for these flags
-                                       break;
-                               }
+                               print("stopping the ", flag.netname, " from moving.\n");
+                               break;
+                       }
+                       
+                       default:
+                       case FLAG_BASE:
+                       case FLAG_CARRY:
+                       {
+                               // do nothing for these flags
+                               break;
                        }
                }
        }