Following my discussion in the general thread I went ahead and dug into the code. I still have no idea why this was more prevalent in the Sand Worm Lair than anywhere else that I've been. When a summoned creature doesn't find a target it sets its target to the summoner in order to follow it. Now when a new target comes along there is some small chance that the summoned creature can ditch its target, otherwise it keeps the same target. When the target is the summoner this causes a problem because the summoned creature will then just follow you around instead of attacking. It could be that the line of sight craziness in the sand lair just highlights the problem more than other places. I'm not sure if this is the best way to fix since I don't know all the code but I added one line the following to game/modules/tome/ai/summon.lua:
Code: Select all
-- Do the normal AI, otherwise follows summoner
if self.ai_target.actor == self.summoner then self.ai_target.actor = nil end
if self:runAI("target_simple") then
return self:runAI(self.ai_real)
else
self.ai_target.actor = self.summoner
local ret = self:runAI(self.ai_real)
self.ai_target.actor = nil
return ret
end