clean up get_hit_sound messages
The first message has a couple of problems. Technically, get_hit_sound is not a tag, and there is a stray quote mark at the end. Also, i+1 points to the line number of the [/unit] tag, which is not particularly helpful information. This can be changed to point to the line of the get_hit_sound attribute. For the second message, the %d get_hit_sound is an index position, so +1 for the line number.
This commit is contained in:
parent
ec6a49a06b
commit
978245b1fb
1 changed files with 2 additions and 2 deletions
|
@ -1017,12 +1017,12 @@ def hack_syntax(filename, lines):
|
|||
elif "[/unit]" in lines[i]:
|
||||
if unit_id and get_hit_sound:
|
||||
if has_defense_anim:
|
||||
print 'wmllint: "%s", line %d: unit%s has both deprecated get_hit_sound tag and a DEFENSE_ANIM"'%(filename, i+1, unit_id)
|
||||
print 'wmllint: "%s", line %d: unit%s has both deprecated get_hit_sound key and a DEFENSE_ANIM'%(filename, get_hit_sound+1, unit_id)
|
||||
else:
|
||||
new_anim = "{DEFENSE_ANIM %s %s %s}" % \
|
||||
(unit_image, unit_image, unit_sound)
|
||||
(key, prefix, val, comment) = parse_attribute(lines[get_hit_sound])
|
||||
print 'wmllint: "%s", line %d: unit%s gets %s'%(filename, get_hit_sound, unit_id, new_anim)
|
||||
print 'wmllint: "%s", line %d: unit%s gets %s'%(filename, get_hit_sound+1, unit_id, new_anim)
|
||||
lines[get_hit_sound] = leader(lines[get_hit_sound]) \
|
||||
+ new_anim + comment
|
||||
modcount += 1
|
||||
|
|
Loading…
Add table
Reference in a new issue