From: Rudolf Polzer Date: Mon, 16 Jan 2012 09:47:03 +0000 (+0100) Subject: add an entity info_autoscreenshot to define autoscreenshot camera location X-Git-Tag: xonotic-v0.6.0~157^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f2b1ab8a5de202188939f34cb702a229812c3e48;p=xonotic%2Fxonotic-data.pk3dir.git add an entity info_autoscreenshot to define autoscreenshot camera location --- diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 57a09fe38..d3b44b67a 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -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,6 +219,21 @@ float CheatImpulse(float i) break; case CHIMPULSE_TELEPORT: IS_CHEAT(i, 0, 0); + if(self.movetype == MOVETYPE_NOCLIP) + { + entity e = find(world, classname, "info_autoscreenshot"); + if(e) + { + 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)) { self.angles_x = -self.angles_x;