]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Merge remote branch 'origin/master' into samual/menu_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index 57a09fe3808ac8997b2a557010fb442e24827dc8..e7154b7f52f17617b9a79c7560aba4e551f99161 100644 (file)
@@ -92,6 +92,11 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
        if((++attempting, !CheatsAllowed(i,argc,fr))) \
                break
 
+void spawnfunc_info_autoscreenshot()
+{
+       // empty spawnfunc just so this entity can exist
+}
+
 float CheatImpulse(float i)
 {
        BEGIN_CHEAT_FUNCTION();
@@ -214,8 +219,25 @@ float CheatImpulse(float i)
                        break;
                case CHIMPULSE_TELEPORT:
                        IS_CHEAT(i, 0, 0);
+                       if(self.movetype == MOVETYPE_NOCLIP)
+                       {
+                               e = find(world, classname, "info_autoscreenshot");
+                               if(e)
+                               {
+                                       sprint(self, "Emergency teleport used info_autoscreenshot location\n");
+                                       setorigin(self, e.origin);
+                                       self.angles = e.angles;
+                                       remove(e);
+                                       // should we? self.angles_x = -self.angles_x;
+                                       self.fixangle = TRUE;
+                                       self.velocity = '0 0 0';
+                                       DID_CHEAT();
+                                       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))
                        {
+                               sprint(self, "Emergency teleport used random location\n");
                                self.angles_x = -self.angles_x;
                                self.fixangle = TRUE;
                                self.velocity = '0 0 0';