Find, and fix, [allow_recruit] and [disallow_recruit] tags...

...with  recruit= rather than type= key.
This commit is contained in:
Eric S. Raymond 2009-10-31 16:07:21 +00:00
parent dd6fe7dea8
commit a8d02dc1a5
4 changed files with 9 additions and 6 deletions

View file

@ -123,22 +123,22 @@ There are no villages in this scenario - you must use healers instead. Use hit-a
[then]
[disallow_recruit]
side=2
recruit="Orcish Archer, Orcish Grunt, Wolf Rider"
type="Orcish Archer, Orcish Grunt, Wolf Rider"
[/disallow_recruit]
[allow_recruit]
side=2
recruit="Orcish Crossbowman, Orcish Warrior"
type="Orcish Crossbowman, Orcish Warrior"
[/allow_recruit]
{VARIABLE_OP modulo_factor random 2..4}
[/then]
[else]
[disallow_recruit]
side=2
recruit="Orcish Crossbowman, Orcish Warrior"
type="Orcish Crossbowman, Orcish Warrior"
[/disallow_recruit]
[allow_recruit]
side=2
recruit="Orcish Archer, Orcish Grunt, Wolf Rider"
type="Orcish Archer, Orcish Grunt, Wolf Rider"
[/allow_recruit]
[/else]
[/if]

View file

@ -422,7 +422,7 @@
name=turn 20
[allow_recruit]
side=2
recruit=Orcish Warrior,Orcish Crossbowman,Troll
type=Orcish Warrior,Orcish Crossbowman,Troll
[/allow_recruit]
[/event]

View file

@ -914,7 +914,7 @@
[allow_recruit]
side=2
recruit=Fire Drake,Drake Flare,Drake Warrior
type=Fire Drake,Drake Flare,Drake Warrior
[/allow_recruit]
[message]

View file

@ -758,6 +758,9 @@ def local_sanity_check(filename, nav, key, prefix, value, comment):
"villages_per_scout", "leader_value", "village_value",
"aggression", "caution", "attack_depth", "grouping"):
print errlead + key + " outside [ai] scope"
# Bad [recruit] attribute
if parent in ("[allow_recruit]", "[disallow_recruit]") and key == "recruit":
print errlead + "recruit= should be type="
def global_sanity_check(filename, lines):
"Perform sanity and consistency checks on input files."