Station Guardian MAI: bug fix for unreachable stations
Keep guardian in place if the station is unreachable.
This commit is contained in:
parent
d83a75fae5
commit
0014ef3f46
2 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue