]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_lights.qc
Properly support team field on trigger_multiple
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_lights.qc
index 9e2cd1156f6a282975b18b73bca24d041e9e6746..852f1efc01d70cda4a73a3d903a67c20a67e1601 100644 (file)
@@ -1,5 +1,8 @@
 #include "g_lights.qh"
 
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
+
 void train_next(entity this);
 
 const float LOOP = 1;
@@ -37,7 +40,7 @@ flags:
 void dynlight_think(entity this)
 {
        if(!this.owner)
-               remove(this);
+               delete(this);
 
        this.nextthink = time + 0.1;
 }
@@ -45,10 +48,10 @@ void dynlight_find_aiment(entity this)
 {
        entity targ;
        if (!this.target)
-               objerror ("dynlight: no target to follow");
+               objerror (this, "dynlight: no target to follow");
 
-       targ = find(world, targetname, this.target);
-       this.movetype = MOVETYPE_FOLLOW;
+       targ = find(NULL, targetname, this.target);
+       set_movetype(this, MOVETYPE_FOLLOW);
        this.aiment = targ;
        this.owner = targ;
        this.punchangle = targ.angles;
@@ -61,11 +64,11 @@ void dynlight_find_path(entity this)
 {
        entity targ;
        if (!this.target)
-               objerror ("dynlight: no target to follow");
+               objerror (this, "dynlight: no target to follow");
 
-       targ = find(world, targetname, this.target);
+       targ = find(NULL, targetname, this.target);
        this.target = targ.target;
-       setorigin (this, targ.origin);
+       setorigin(this, targ.origin);
        setthink(this, train_next);
        this.nextthink = time + 0.1;
 }
@@ -73,9 +76,9 @@ void dynlight_find_target(entity this)
 {
        entity targ;
        if (!this.target)
-               objerror ("dynlight: no target to follow");
+               objerror (this, "dynlight: no target to follow");
 
-       targ = find(world, targetname, this.target);
+       targ = find(NULL, targetname, this.target);
        setattachment(this, targ, this.dtagname);
        this.owner = targ;
        setthink(this, dynlight_think);
@@ -97,7 +100,7 @@ spawnfunc(dynlight)
        this.lefty = this.light_lev;
        this.use = dynlight_use;
        setsize (this, '0 0 0', '0 0 0');
-       setorigin (this, this.origin);
+       setorigin(this, this.origin);
        //this.pflags = PFLAGS_FULLDYNAMIC;
        this.solid = SOLID_NOT;
        //this.blocked = func_null;
@@ -123,7 +126,7 @@ spawnfunc(dynlight)
        if (this.target)
 //     if (!(this.spawnflags & DFOLLOW))
        {
-               this.movetype = MOVETYPE_NOCLIP;
+               set_movetype(this, MOVETYPE_NOCLIP);
                if (!this.speed)
                        this.speed = 100;
                InitializeEntity(this, dynlight_find_path, INITPRIO_FINDTARGET);