Convert nested if structure to while loop
This commit is contained in:
parent
8a65202fc8
commit
1a654391df
1 changed files with 16 additions and 59 deletions
|
@ -948,76 +948,33 @@
|
|||
[/have_unit]
|
||||
[/filter_condition]
|
||||
|
||||
[store_unit]
|
||||
[filter]
|
||||
side=1
|
||||
level=4
|
||||
x,y=recall,recall
|
||||
[/filter]
|
||||
|
||||
kill=no
|
||||
variable=possible_helpers
|
||||
[/store_unit]
|
||||
|
||||
[if]
|
||||
{VARIABLE helper_level 4}
|
||||
[while]
|
||||
[variable]
|
||||
name=possible_helpers.length
|
||||
equals=0
|
||||
name=helper_level
|
||||
greater_than=0
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[and]
|
||||
[variable]
|
||||
name=possible_helpers.length
|
||||
equals=0
|
||||
[/variable]
|
||||
[/and]
|
||||
[do]
|
||||
[store_unit]
|
||||
[filter]
|
||||
side=1
|
||||
level=3
|
||||
level=$helper_level
|
||||
x,y=recall,recall
|
||||
[/filter]
|
||||
|
||||
kill=no
|
||||
variable=possible_helpers
|
||||
[/store_unit]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=possible_helpers.length
|
||||
equals=0
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[store_unit]
|
||||
[filter]
|
||||
side=1
|
||||
level=2
|
||||
x,y=recall,recall
|
||||
[/filter]
|
||||
|
||||
kill=no
|
||||
variable=possible_helpers
|
||||
[/store_unit]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=possible_helpers.length
|
||||
equals=0
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[store_unit]
|
||||
[filter]
|
||||
side=1
|
||||
level=1
|
||||
x,y=recall,recall
|
||||
[/filter]
|
||||
|
||||
kill=no
|
||||
variable=lvl1_recalls
|
||||
[/store_unit]
|
||||
[/then]
|
||||
[/if]
|
||||
[/then]
|
||||
[/if]
|
||||
[/then]
|
||||
[/if]
|
||||
{VARIABLE_OP helper_level sub 1}
|
||||
[/do]
|
||||
[/while]
|
||||
{CLEAR_VARIABLE helper_level}
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
|
|
Loading…
Add table
Reference in a new issue