]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/sv_monsters.qc
Clean up monster spawn function a little, allow setting invasion spawnpoints to spawn...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / sv_monsters.qc
index 9ac1f4e14084f0adaa1ec8f40f2047ac14dd2ef9..02ad23817c67642f8026b737f466d94d168c4e47 100644 (file)
@@ -692,7 +692,8 @@ void Monster_CalculateVelocity(entity this, vector to, vector from, float turnra
 
 void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed)
 {
-       if(this.target2) { this.goalentity = find(NULL, targetname, this.target2); }
+       // update goal entity if lost
+       if(this.target2 && this.goalentity.targetname != this.target2) { this.goalentity = find(NULL, targetname, this.target2); }
 
        entity targ;