Tactical AI fleeing needs to check for never_move
Posted: Tue May 24, 2011 6:49 am
The tactical AI canFlee function should check for never_move, otherwise bosses like the Spellblaze Crystal will not attack when in melee distance.
Code: Select all
diff --git a/game/modules/tome/ai/tactical.lua b/game/modules/tome/ai/tactical.lua
index 6686d00..dfcafef 100644
--- a/game/modules/tome/ai/tactical.lua
+++ b/game/modules/tome/ai/tactical.lua
@@ -37,6 +37,9 @@ local checkLOS = function(sx, sy, tx, ty)
end
local canFleeDmapKeepLos = function(self)
+ if self.never_move then
+ return false
+ end
if self.ai_target.actor then
local act = self.ai_target.actor
local c = act:distanceMap(self.x, self.y)