]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/misc/follow.qc
Fix panel show flags checks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / misc / follow.qc
index dbe1cb7d8c0013aee51a65788547def7624610b3..d19d9da0853c856dd5132dff40fa42d22945c042 100644 (file)
@@ -4,16 +4,16 @@
 void follow_init(entity this)
 {
        entity src, dst;
-       src = world;
-       dst = world;
+       src = NULL;
+       dst = NULL;
        if(this.killtarget != "")
-               src = find(world, targetname, this.killtarget);
+               src = find(NULL, targetname, this.killtarget);
        if(this.target != "")
-               dst = find(world, targetname, this.target);
+               dst = find(NULL, targetname, this.target);
 
        if(!src && !dst)
        {
-               objerror("follow: could not find target/killtarget");
+               objerror(this, "follow: could not find target/killtarget");
                return;
        }
 
@@ -25,7 +25,7 @@ void follow_init(entity this)
        }
        else if(!src || !dst)
        {
-               objerror("follow: could not find target/killtarget");
+               objerror(this, "follow: could not find target/killtarget");
                return;
        }
        else if(this.spawnflags & 1)
@@ -41,13 +41,13 @@ void follow_init(entity this)
                }
 
                dst.solid = SOLID_NOT; // solid doesn't work with attachment
-               remove(this);
+               delete(this);
        }
        else
        {
                if(this.spawnflags & 2)
                {
-                       dst.movetype = MOVETYPE_FOLLOW;
+                       set_movetype(dst, MOVETYPE_FOLLOW);
                        dst.aiment = src;
                        // dst.punchangle = '0 0 0'; // keep unchanged
                        dst.view_ofs = dst.origin;
@@ -58,7 +58,7 @@ void follow_init(entity this)
                        follow_sameorigin(dst, src);
                }
 
-               remove(this);
+               delete(this);
        }
 }