DiD S2: When ambushed by goblins, cancel any pending attack (#3227)

This happens in a village-capture event, so the unit has finished
moving for this turn in any case.

(cherry-picked from commit 8d055bf038)
This commit is contained in:
stevecotton 2018-06-08 23:25:34 +02:00 committed by ln-zookeeper
parent 98cc5372a7
commit ae9559d8f0

View file

@ -255,6 +255,19 @@
[/then]
[/if]
# If there was a goblin next to the village before the guards spawned, the player may have
# already commanded their unit to attack. But as there are now more enemies, give the
# player a chance to choose a different opponent.
[if]
[variable]
name=number_of_guards
greater_than=0
[/variable]
[then]
[cancel_action][/cancel_action]
[/then]
[/if]
{CLEAR_VARIABLE number_of_guards,guard_location}
[/event]