wmllint: Handle deprecated implicit side=1 in more actions;...
...run the new code in mainline Shame on you, esr. This commit handles [remove/place_shroud], [gold] and [modify_side/ai]... ...using modified code derived from patch #2666
This commit is contained in:
parent
97da3fcaa3
commit
f0a3854f1b
7 changed files with 51 additions and 1 deletions
|
@ -64,7 +64,8 @@ Version 1.9.8+svn:
|
|||
* decreased the impact resist of the Falcon line from 0% to -10%
|
||||
* The Naffat line (Naffat, Qatif-al-nar, Tineen) is no longer able to get the strong trait
|
||||
* Miscellaneous and bug fixes:
|
||||
* Teach wmllint to fix deprecated implicit side=1 in [store_gold] actions
|
||||
* Teach wmllint to fix deprecated implicit side=1 in [store_gold], [remove_shroud],
|
||||
[place_shroud], [gold], [modify_side], [modify_ai] actions
|
||||
|
||||
Version 1.9.8:
|
||||
* Campaigns:
|
||||
|
|
|
@ -310,6 +310,7 @@
|
|||
[then]
|
||||
[gold]
|
||||
amount=20
|
||||
side=1
|
||||
[/gold]
|
||||
[/then]
|
||||
[/if]
|
||||
|
|
|
@ -130,6 +130,7 @@
|
|||
|
||||
[remove_shroud]
|
||||
find_in=locations_outside
|
||||
side=1
|
||||
[/remove_shroud]
|
||||
|
||||
{GENERIC_UNIT 3 "Troll Whelp" 6 3}
|
||||
|
@ -552,6 +553,7 @@
|
|||
x=10, 11, 12, 13, 14
|
||||
y=13,13-14,13-14,14-15,14-15
|
||||
[/not]
|
||||
side=1
|
||||
[/place_shroud]
|
||||
[if]
|
||||
[have_unit]
|
||||
|
|
|
@ -767,6 +767,7 @@ Yet for some reason I fear these brothers more. If Mordak were here it would be
|
|||
[remove_shroud]
|
||||
x=1-8,9-10,5
|
||||
y=1-12,1-7,13
|
||||
side=1
|
||||
[/remove_shroud]
|
||||
[/event]
|
||||
|
||||
|
|
|
@ -1422,6 +1422,7 @@
|
|||
#ifdef HARD
|
||||
amount=150
|
||||
#endif
|
||||
side=1
|
||||
[/gold]
|
||||
[/event]
|
||||
[/then]
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
[command]
|
||||
[gold]
|
||||
amount=-1
|
||||
side=1
|
||||
[/gold]
|
||||
[message]
|
||||
speaker=unit
|
||||
|
|
|
@ -1600,6 +1600,49 @@ def hack_syntax(filename, lines):
|
|||
lines[i] = lines[i].replace("{@campaigns/", "{~add-ons/")
|
||||
elif "@add-ons/" in lines[i]:
|
||||
lines[i] = lines[i].replace("{@add-ons/", "{~add-ons/")
|
||||
# some tags do no longer support default side=1 attribute but may use [filter_side]
|
||||
# with a SSF instead
|
||||
# (since 1.9.5, 1.9.6)
|
||||
side_one_tags_allowing_filter_side = (
|
||||
("remove_shroud"),
|
||||
("place_shroud"),
|
||||
("gold"),
|
||||
("modify_side"),
|
||||
("modify_ai")
|
||||
)
|
||||
outside_of_theme_wml = True # theme wml contains a [gold] tag - exclude that case
|
||||
in_side_one_tag = False
|
||||
side_one_tag_needs_side_one = True
|
||||
for i in range(len(lines)):
|
||||
if "no-syntax-rewrite" in lines[i]:
|
||||
break
|
||||
precomment = lines[i].split("#")[0]
|
||||
if outside_of_theme_wml:
|
||||
if "[theme]" in precomment:
|
||||
outside_of_theme_wml = False
|
||||
else:
|
||||
if "[/theme]" in precomment:
|
||||
outside_of_theme_wml = True
|
||||
if outside_of_theme_wml:
|
||||
if not in_side_one_tag:
|
||||
for j in range(len(side_one_tags_allowing_filter_side)):
|
||||
if "[" + side_one_tags_allowing_filter_side[j] + "]" in precomment:
|
||||
in_side_one_tag = True
|
||||
else:
|
||||
if side_one_tag_needs_side_one:
|
||||
if "side=" in precomment:
|
||||
side_one_tag_needs_side_one = False
|
||||
if "[filter_side]" in precomment:
|
||||
side_one_tag_needs_side_one = False
|
||||
for j in range(len(side_one_tags_allowing_filter_side)):
|
||||
if "[/" + side_one_tags_allowing_filter_side[j] + "]" in precomment:
|
||||
if side_one_tag_needs_side_one:
|
||||
if verbose:
|
||||
print '"%s", line %d: inserting "side=1"'%(filename, i+1)
|
||||
lines.insert(i, leader(precomment) + baseindent + "side=1\n")
|
||||
in_side_one_tag = False
|
||||
side_one_tag_needs_side_one = True
|
||||
break
|
||||
# More syntax transformations would go here.
|
||||
return lines
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue