]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_lights.qc
Step 5: complete
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_lights.qc
index 2b1d12b9494df4d86591989f1c6c8112df2052b0..9e2cd1156f6a282975b18b73bca24d041e9e6746 100644 (file)
@@ -1,6 +1,6 @@
 #include "g_lights.qh"
 
-void train_next();
+void train_next(entity this);
 
 const float LOOP = 1;
 
@@ -34,53 +34,52 @@ flags:
 "NOSHADOW" will not cast shadows in realtime lighting mode
 "FOLLOW" will follow the entity which "targetname" matches "target"
 */
-void dynlight_think()
+void dynlight_think(entity this)
 {
-    SELFPARAM();
-       if(!self.owner)
-               remove(self);
+       if(!this.owner)
+               remove(this);
 
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 }
 void dynlight_find_aiment(entity this)
 {
        entity targ;
-       if (!self.target)
+       if (!this.target)
                objerror ("dynlight: no target to follow");
 
-       targ = find(world, targetname, self.target);
-       self.movetype = MOVETYPE_FOLLOW;
-       self.aiment = targ;
-       self.owner = targ;
-       self.punchangle = targ.angles;
-       self.view_ofs = self.origin - targ.origin;
-       self.v_angle = self.angles - targ.angles;
-       self.think = dynlight_think;
-       self.nextthink = time + 0.1;
+       targ = find(world, targetname, this.target);
+       this.movetype = MOVETYPE_FOLLOW;
+       this.aiment = targ;
+       this.owner = targ;
+       this.punchangle = targ.angles;
+       this.view_ofs = this.origin - targ.origin;
+       this.v_angle = this.angles - targ.angles;
+       setthink(this, dynlight_think);
+       this.nextthink = time + 0.1;
 }
 void dynlight_find_path(entity this)
 {
        entity targ;
-       if (!self.target)
+       if (!this.target)
                objerror ("dynlight: no target to follow");
 
-       targ = find(world, targetname, self.target);
-       self.target = targ.target;
-       setorigin (self, targ.origin);
-       self.think = train_next;
-       self.nextthink = time + 0.1;
+       targ = find(world, targetname, this.target);
+       this.target = targ.target;
+       setorigin (this, targ.origin);
+       setthink(this, train_next);
+       this.nextthink = time + 0.1;
 }
 void dynlight_find_target(entity this)
 {
        entity targ;
-       if (!self.target)
+       if (!this.target)
                objerror ("dynlight: no target to follow");
 
-       targ = find(world, targetname, self.target);
-       setattachment(self, targ, self.dtagname);
-       self.owner = targ;
-       self.think = dynlight_think;
-       self.nextthink = time + 0.1;
+       targ = find(world, targetname, this.target);
+       setattachment(this, targ, this.dtagname);
+       this.owner = targ;
+       setthink(this, dynlight_think);
+       this.nextthink = time + 0.1;
 }
 void dynlight_use(entity this, entity actor, entity trigger)
 {