default to level 0 (like wesnoth) also on ValueError
This commit is contained in:
parent
c20896690c
commit
a766a9c380
1 changed files with 4 additions and 2 deletions
6
data/tools/unit_tree/helpers.py
Normal file → Executable file
6
data/tools/unit_tree/helpers.py
Normal file → Executable 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)
|
||||
|
|
Loading…
Add table
Reference in a new issue