Station Guardian MAI: bug fix for unreachable stations

Keep guardian in place if the station is unreachable.
This commit is contained in:
mattsc 2014-11-21 19:42:42 -08:00
parent d83a75fae5
commit 0014ef3f46
2 changed files with 6 additions and 0 deletions

View file

@ -4,6 +4,8 @@ Version 1.12.0+dev:
files.
* Language and i18n:
* Updated translations: Portuguese
* Miscellaneous and bug fixes:
* Stationed Guardian Micro AI: bug fix for unreachable stations
* WML engine:
* Fixed nested macros emitting incorrect bindings to the default 'wesnoth'
textdomain at the end of a substitution instead of the parent textdomain,

View file

@ -97,6 +97,10 @@ function ca_stationed_guardian:execution(ai, cfg)
-- If no enemy is within the target zone, move toward station position
else
local nh = AH.next_hop(guardian, cfg.station_x, cfg.station_y)
if not nh then
nh = { guardian.x, guardian.y }
end
AH.movefull_stopunit(ai, guardian, nh)
end