diff --git a/game/engines/default/engine/interface/ActorAI.lua b/game/engines/default/engine/interface/ActorAI.lua index d8437583625052cfda1423ec51feb119d19462c3..c45c2e23a2af6a8691750a822a6c09f2152a5c8a 100644 --- a/game/engines/default/engine/interface/ActorAI.lua +++ b/game/engines/default/engine/interface/ActorAI.lua @@ -152,6 +152,8 @@ function _M:setTarget(target, last_seen) end end +_M.AI_SEEN_CACHE_DELAY = 10 * 100 + --- Returns the seen coords of the target -- This will usually return the exact coords, but if the target is only partially visible (or not at all) -- it will return estimates, to throw the AI a bit off (up to 10 tiles error) @@ -166,11 +168,11 @@ function _M:aiSeeTargetPos(target) -- Guess Cache turn to update position guess (so it's consistent during a turn) -- Start at -1000 to make sure ti gets run the first time. - LSeen.GCache_turn = LSeen.GCache_turn or game.turn - 1000 + LSeen.GCache_turn = LSeen.GCache_turn or game.turn - self.AI_SEEN_CACHE_DELAY -- Guess Cache known turn for spread calculation (self.ai_state.target_last_seen.turn -- can't be used because it's needed by FOV code) - LSeen.GCknown_turn = LSeen.GCknown_turn or game.turn - 1000 + LSeen.GCknown_turn = LSeen.GCknown_turn or game.turn - self.AI_SEEN_CACHE_DELAY -- Check if target is currently seen local see, chance = self:canSee(target)