diff --git a/eastern flames/scripts/c_doenemyai/c_doenemyai.gml b/eastern flames/scripts/c_doenemyai/c_doenemyai.gml index cc9a022..207f47a 100644 --- a/eastern flames/scripts/c_doenemyai/c_doenemyai.gml +++ b/eastern flames/scripts/c_doenemyai/c_doenemyai.gml @@ -1,7 +1,7 @@ function c_doenemyai(target) { switch target.data.aitype { case AI.AFK: - var dude = c_findnearestunit(ARMY.US); + var dude = c_findnearestunit(target.pos.x,target.pos.y,ARMY.US); var dist = c_tiledist(target.pos.x, target.pos.y, dude.pos.x, dude.pos.y); if dist.x+dist.y <= target.data.rng.val { log("started combat") @@ -12,7 +12,7 @@ function c_doenemyai(target) { target.waiting = true; break; case AI.KILLER: - var dude = c_findnearestunit(ARMY.US); + var dude = c_findnearestunit(target.pos.x,target.pos.y,ARMY.US); repeat(target.data.mov.val) { var guy = c_gettile(target.pos.x, target.pos.y); if target.pos.x < dude.pos.x { @@ -41,7 +41,7 @@ function c_doenemyai(target) { target.waiting = true; break; case AI.WAITER: - var dude = c_findnearestunit(ARMY.US); + var dude = c_findnearestunit(target.pos.x,target.pos.y,ARMY.US); var dist = c_tiledist(target.pos.x, target.pos.y, dude.pos.x, dude.pos.y); if dist.x+dist.y > target.data.mov.val + target.data.rng.val { target.waiting = true;