From 255d9f1e99b2d170f5bb7803bff8377e42da706f Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 20 Jan 2012 17:20:25 +0100 Subject: [PATCH] implement target support --- qcsrc/server/cheats.qc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index b37581cee..103febb72 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -93,10 +93,29 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a 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); + 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 } -- 2.39.2