]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/gamecommand.qc
Merge remote branch 'origin/pooga/keepawaybots'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / gamecommand.qc
index b0085224fadb3064e9aef6a817c1c2a6fc263222..c8d2af14368d49bd1aabe54840822db95e1499d8 100644 (file)
@@ -665,7 +665,35 @@ void changematchtime(float delta, float mi, float ma)
                        return;
        }
 
-       cvar_set("timelimit", ftos(new));
+       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)
@@ -779,10 +807,10 @@ void GameCommand(string command)
                                if(argc == 4)
                                {
                                        s = argv(2);
-                                       s = strreplace(s, "\n", "");
-                                       s = strreplace(s, "\\", "\\\\");
-                                       s = strreplace(s, "$", "$$");
-                                       s = strreplace(s, "\"", "\\\"");
+                                       s = strreplace("\n", "", s);
+                                       s = strreplace("\\", "\\\\", s);
+                                       s = strreplace("$", "$$", s);
+                                       s = strreplace("\"", "\\\"", s);
                                        stuffcmd(client, sprintf("\ninfobar %f \"%s\"\n", stof(argv(3)), s));
                                }
                                else
@@ -840,7 +868,7 @@ void GameCommand(string command)
 
        if (argv(0) == "lockteams")
        {
-               if(teams_matter)
+               if(teamplay)
                {
                        lockteams = 1;
                        bprint("^1The teams are now locked.\n");
@@ -852,7 +880,7 @@ void GameCommand(string command)
 
        if (argv(0) == "unlockteams")
        {
-               if(teams_matter)
+               if(teamplay)
                {
                        lockteams = 0;
                        bprint("^1The teams are now unlocked.\n");
@@ -871,7 +899,7 @@ void GameCommand(string command)
                //      2 (10) no centerprint, admin message
                //      3 (11) no centerprint, no admin message
 
-               if(!teams_matter) {  // death match
+               if(!teamplay) {  // death match
                        print("Currently not playing a team game\n");
                        return;
                }
@@ -1451,6 +1479,12 @@ void GameCommand(string command)
                return;
        }
 
+       if(argv(0) == "modelbug")
+       {
+               modelbug();
+               return;
+       }
+
        print("Invalid command. For a list of supported commands, try sv_cmd help.\n");
 }