X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcheats.qc;h=5ba860940a014344a3338f27551448ddbce0ad31;hb=1c2bdc1f0012349f80906e05902ce19bed35be16;hp=57a09fe3808ac8997b2a557010fb442e24827dc8;hpb=737b9aa03c6796ac761630483cb5e9bf5ef56174;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 57a09fe38..5ba860940 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -92,6 +92,34 @@ 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() +{ + 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) { BEGIN_CHEAT_FUNCTION(); @@ -214,8 +242,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';