]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/updatecommands
authorSamual <samual@xonotic.org>
Tue, 12 Jul 2011 04:31:55 +0000 (00:31 -0400)
committerSamual <samual@xonotic.org>
Tue, 12 Jul 2011 04:31:55 +0000 (00:31 -0400)
1  2 
qcsrc/server/gamecommand.qc

index ff7231395d6ec40c8a1bd9dbede03ef1373cae68,9fce6368c798e2981b14b657d431eecafc0c4778..8397031321220524458dd65252348fb3bb1498c6
@@@ -626,18 -627,77 +627,87 @@@ void make_mapinfo_Think(
        }
  }
  
+ void changematchtime(float delta, float mi, float ma)
+ {
+       float cur;
+       float new;
+       float lim;
+       if(delta == 0)
+               return;
+       if(autocvar_timelimit < 0)
+               return;
+       if(mi <= 10)
+               mi = 10; // at least ten sec in the future
+       cur = time - game_starttime;
+       if(cur > 0)
+               mi += cur; // from current time!
+       lim = autocvar_timelimit * 60;
+       if(delta > 0)
+       {
+               if(lim == 0)
+                       return; // cannot increase any further
+               else if(lim < ma)
+                       new = min(ma, lim + delta);
+               else // already above maximum: FAIL
+                       return;
+       }
+       else
+       {
+               if(lim == 0) // infinite: try reducing to max, if we are allowed to
+                       new = max(mi, ma);
+               else if(lim > mi) // above minimum: decrease
+                       new = max(mi, lim + delta);
+               else // already below minimum: FAIL
+                       return;
+       }
+       cvar_set("timelimit", ftos(new / 60));
+ }
+ float g_clientmodel_genericsendentity (entity to, float sf);
+ void modelbug_make_svqc();
+ void modelbug_make_csqc()
+ {
+       Net_LinkEntity(self, TRUE, 0, g_clientmodel_genericsendentity);
+       self.think = modelbug_make_svqc;
+       self.nextthink = time + 1;
+       setorigin(self, self.origin - '0 0 8');
+ }
+ void modelbug_make_svqc()
+ {
+       self.SendEntity = func_null;
+       self.think = modelbug_make_csqc;
+       self.nextthink = time + 1;
+       setorigin(self, self.origin + '0 0 8');
+ }
+ void modelbug()
+ {
+       entity e;
+       e = spawn();
+       setorigin(e, nextent(world).origin);
+       precache_model("models_portal.md3");
+       setmodel(e, "models/portal.md3");
+       e.think = modelbug_make_svqc;
+       e.nextthink = time + 1;
+ }
  void GameCommand(string command)
  {
 +      // ===== TODO list =====
 +      // Update the help/command list to actually show all the commands
 +      
 +      // Re-order all the commands in alphabetical order -- or in some other easily recognizable order ;3 (if possible)
 +      
 +      // Add extra help to each command when used improperly 
 +      
 +      // Add ifdef to stuffto so that is can only be used when the game code is compiled for it 
 +      //(this way it's more obscure and harder to abuse on normal servers)
 +
        float argc;
        entity client, e;
        vector v;