From: Rudolf Polzer Date: Fri, 20 Jan 2012 16:20:25 +0000 (+0100) Subject: implement target support X-Git-Tag: xonotic-v0.6.0~104^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=255d9f1e99b2d170f5bb7803bff8377e42da706f;p=xonotic%2Fxonotic-data.pk3dir.git implement target support --- 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 }