]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
implement target support
authorRudolf Polzer <divverent@alientrap.org>
Fri, 20 Jan 2012 16:20:25 +0000 (17:20 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 20 Jan 2012 16:21:02 +0000 (17:21 +0100)
qcsrc/server/cheats.qc

index b37581cee9228bc4798cf72dee356958181e5e7e..103febb72f239186aa5ecf693c56377ef601b0d1 100644 (file)
@@ -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
 }