fixed bugs in ai's fix for bug #12666

This commit is contained in:
Fabian Müller 2008-12-05 14:45:30 +00:00
parent e72e532fae
commit 302dad2eaa

View File

@ -188,41 +188,39 @@
[/filter]
[/store_unit]
# Postponed due to stringfreeze. Wait for 1.7.0
#[if]
# [variable]
# name=l3_selector_store.length
# numerical_equals=0
# [/variable]
# [then]
# [set_variable]
# name=left_behind
# value= _ "some experienced warriors"
# [/set_variable]
# [/then]
#[/if]
[if]
[variable]
name=l3_selector_store.length
numerical_equals=0
[/variable]
[then]
[set_variable]
name=left_behind
value= _ "some experienced warriors"
[/set_variable]
[/then]
[/if]
{VARIABLE l3_length l3_selector_store.length}
{VARIABLE l3_length $l3_selector_store.length}
{VARIABLE_OP l3_length add -1}
{FOREACH l3_selector_store i}
# for-case, what a great anti-pattern
[switch]
variable=unit
variable=i
[case]
value=0
[set_variable]
name=left_behind
format=$l3_selectorstore[$i].name
format=$l3_selector_store[$i].name
[/set_variable]
[/case]
[case]
value=$l3_length
[set_variable]
name=left_behind
format=$left_behind + _ " and " + $l3_selector_store[$i].name
[/set_variable]
[/case]
# Also postponed, wait for 1.7.0
#[case]
# value=$l3_length
# [set_variable]
# name=left_behind
# format=$left_behind + _ " and " + $l3_selector_store[$i].name
# [/set_variable]
#[/case]
[else]
[set_variable]
name=left_behind
@ -231,7 +229,7 @@
[/else]
[/switch]
{NEXT i}
{CLEAR_VARIABLE unit}
{CLEAR_VARIABLE l3_length}
[/event]
[event]