entity src, dst;
src = world;
dst = world;
- if(self.killtarget != "")
- src = find(world, targetname, self.killtarget);
- if(self.target != "")
- dst = find(world, targetname, self.target);
+ if(this.killtarget != "")
+ src = find(world, targetname, this.killtarget);
+ if(this.target != "")
+ dst = find(world, targetname, this.target);
if(!src && !dst)
{
return;
}
- if(self.jointtype)
+ if(this.jointtype)
{
// already done :P entity must stay
- self.aiment = src;
- self.enemy = dst;
+ this.aiment = src;
+ this.enemy = dst;
}
else if(!src || !dst)
{
objerror("follow: could not find target/killtarget");
return;
}
- else if(self.spawnflags & 1)
+ else if(this.spawnflags & 1)
{
// attach
- if(self.spawnflags & 2)
+ if(this.spawnflags & 2)
{
- setattachment(dst, src, self.message);
+ setattachment(dst, src, this.message);
}
else
{
- attach_sameorigin(dst, src, self.message);
+ attach_sameorigin(dst, src, this.message);
}
dst.solid = SOLID_NOT; // solid doesn't work with attachment
- remove(self);
+ remove(this);
}
else
{
- if(self.spawnflags & 2)
+ if(this.spawnflags & 2)
{
dst.movetype = MOVETYPE_FOLLOW;
dst.aiment = src;
follow_sameorigin(dst, src);
}
- remove(self);
+ remove(this);
}
}
spawnfunc(misc_follow)
{
- InitializeEntity(self, follow_init, INITPRIO_FINDTARGET);
+ InitializeEntity(this, follow_init, INITPRIO_FINDTARGET);
}
#endif