]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/gamecommand.qc
add a test case for csqc/svqc entity type switching
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / gamecommand.qc
index a83be998a86e3835e5a95573c26c5a045f11075a..c8d2af14368d49bd1aabe54840822db95e1499d8 100644 (file)
@@ -668,6 +668,34 @@ void changematchtime(float delta, float mi, float ma)
        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)
 {
        float argc;
@@ -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");
 }