Fix issues with LIMIT_RECRUITS...
...as pointed out by user on forum thread 21547 (http://www.wesnoth.org/forum/viewtopic.php?t=21547)
This commit is contained in:
parent
8b9d1c94e2
commit
47e574fa0a
1 changed files with 17 additions and 13 deletions
|
@ -121,6 +121,7 @@
|
|||
|
||||
[event]
|
||||
name=recruit
|
||||
first_time_only=yes
|
||||
|
||||
[filter]
|
||||
side={SIDE}
|
||||
|
@ -145,8 +146,6 @@
|
|||
type={TYPE}
|
||||
[/filter]
|
||||
|
||||
{VARIABLE_OP side_{SIDE}_limited_recruits[$side_{SIDE}_limited_recruits_length|].number_recruited add 1}
|
||||
|
||||
{FOREACH side_{SIDE}_limited_recruits i}
|
||||
[if]
|
||||
[variable]
|
||||
|
@ -154,18 +153,23 @@
|
|||
equals=$unit.type
|
||||
[/variable]
|
||||
|
||||
[variable]
|
||||
name=side_{SIDE}_limited_recruits[$i].number_recruited
|
||||
greater_than_equal_to={LIMIT_NUMBER}
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[disallow_recruit]
|
||||
side={SIDE}
|
||||
type={TYPE}
|
||||
[/disallow_recruit]
|
||||
{VARIABLE_OP side_{SIDE}_limited_recruits[$i].number_recruited add 1}
|
||||
[if]
|
||||
[variable]
|
||||
name=side_{SIDE}_limited_recruits[$i].number_recruited
|
||||
greater_than_equal_to={LIMIT_NUMBER}
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[disallow_recruit]
|
||||
side={SIDE}
|
||||
type={TYPE}
|
||||
[/disallow_recruit]
|
||||
[/then]
|
||||
[/if]
|
||||
[/then]
|
||||
[/if]
|
||||
{NEXT i}
|
||||
[/if]
|
||||
{NEXT i}
|
||||
[/event]
|
||||
#enddef
|
||||
|
|
Loading…
Add table
Reference in a new issue