default to level 0 (like wesnoth) also on ValueError

This commit is contained in:
Gunter Labes 2009-03-31 01:01:44 +00:00
parent c20896690c
commit a766a9c380

6
data/tools/unit_tree/helpers.py Normal file → Executable file
View file

@ -314,8 +314,10 @@ class WesnothList:
try:
level = int(self.get_unit_value(unit, "level"))
except TypeError:
level = 5
if level < 0: level = 5
level = 0
except ValueError:
level = 0
if level < 0: level = 0
unit.level = level
return len(newunits)