]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Merge remote-tracking branch 'origin/master' into samual/notification_rewrite
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index 936f23402d9ab31a7ae4d62ce5d5948c6865ed84..746a22d8940c622f1ffbb7e51060b082886d3c89 100644 (file)
@@ -48,7 +48,7 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
        // dead people cannot cheat
        if(self.deadflag != DEAD_NO)
                return 0;
-       if(self.classname != "player")
+       if(gamestart_sv_cheats < 2 && self.classname != "player")
                return 0;
        
        // sv_clones
@@ -236,7 +236,7 @@ float CheatImpulse(float i)
                                        break;
                                }
                        }
-                       if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((gamestart_sv_cheats >= 2) ? 100000 : 100), 1024, 256))
+                       if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((gamestart_sv_cheats < 2) ? 100 : 100000), 1024, 256))
                        {
                                sprint(self, "Emergency teleport used random location\n");
                                self.angles_x = -self.angles_x;
@@ -707,8 +707,11 @@ float CheatCommand(float argc)
                        {
                                Simple_TeleportPlayer(self, e);
                                remove(self);
+                               self = e;
                                DID_CHEAT();
                        }
+                       else
+                               self = e;
                        break;
        }