]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Merge remote-tracking branch 'origin/divVerent/new-laser-by-morphed'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index 51cbbcec3d61515869e949599660721cdbd7417e..5ba860940a014344a3338f27551448ddbce0ad31 100644 (file)
@@ -92,9 +92,32 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
        if((++attempting, !CheatsAllowed(i,argc,fr))) \
                break
 
+float num_autoscreenshot;
+void info_autoscreenshot_findtarget()
+{
+       entity e;
+       e = find(world, targetname, self.target);
+       if(!e)
+       {
+               objerror("Missing target. FAIL!");
+               return;
+       }
+       vector a = vectoangles(e.origin - self.origin);
+       a_x = -a_x; // don't ask
+       self.angles_x = a_x;
+       self.angles_y = a_y;
+       // we leave Rick Roll alone
+}
 void spawnfunc_info_autoscreenshot()
 {
-       // empty spawnfunc just so this entity can exist
+       if(++num_autoscreenshot > autocvar_g_max_info_autoscreenshot)
+       {
+               objerror("Too many info_autoscreenshot entitites. FAIL!");
+               return;
+       }
+       if(self.target != "")
+               InitializeEntity(self, info_autoscreenshot_findtarget, INITPRIO_FINDTARGET);
+       // this one just has to exist
 }
 
 float CheatImpulse(float i)
@@ -224,7 +247,7 @@ float CheatImpulse(float i)
                                e = find(world, classname, "info_autoscreenshot");
                                if(e)
                                {
-                                       sprint(self, "Emergency teleport uses info_autoscreenshot location\n");
+                                       sprint(self, "Emergency teleport used info_autoscreenshot location\n");
                                        setorigin(self, e.origin);
                                        self.angles = e.angles;
                                        remove(e);
@@ -237,6 +260,7 @@ float CheatImpulse(float i)
                        }
                        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';