Fixed LIMIT_CONTEMPORANEOUS_RECRUITS not handling side numbers >9 correctly.

This commit is contained in:
Lari Nieminen 2012-02-21 17:44:20 +00:00
parent f8879eeff1
commit dcafd0f16a

View file

@ -21,40 +21,41 @@
name=side turn
first_time_only=no
{VARIABLE LCR_temp {SIDES}}
[filter_condition]
# Note: we cannot simply check if {SIDES} contains $side_number,
# because that would break for side numbers >9 ("12" would contain
# both "1" and "2", etc). So instead, we check whether there exists
# a unit which belongs both to the current side as well as {SIDES}.
[have_unit]
side=$side_number
[and]
side={SIDES}
[/and]
[/have_unit]
[/filter_condition]
[if]
[variable]
name=LCR_temp
contains=$side_number
[/variable]
[have_unit]
side=$side_number
type={TYPE}
count="{LIMIT_NUMBER}-99999"
[/have_unit]
[then]
[if]
[have_unit]
side=$side_number
type={TYPE}
count="{LIMIT_NUMBER}-99999"
[/have_unit]
[then]
[disallow_recruit]
side=$side_number
type={TYPE}
[/disallow_recruit]
[/then]
[else]
[allow_recruit]
side=$side_number
type={TYPE}
[/allow_recruit]
[/else]
[/if]
[disallow_recruit]
side=$side_number
type={TYPE}
[/disallow_recruit]
[/then]
[/if]
{CLEAR_VARIABLE LCR_temp}
[else]
[allow_recruit]
side=$side_number
type={TYPE}
[/allow_recruit]
[/else]
[/if]
[/event]
[event]