mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
Try to read default num as float in script if int doesn't work.
This commit is contained in:
parent
7f3eb9970e
commit
97a1ff5186
5
scripts/stats_schema_achievement_gen/achievements_gen.py
Normal file → Executable file
5
scripts/stats_schema_achievement_gen/achievements_gen.py
Normal file → Executable file
@ -64,7 +64,10 @@ def generate_stats_achievements(schema, config_directory):
|
|||||||
for s in stats_out:
|
for s in stats_out:
|
||||||
default_num = 0
|
default_num = 0
|
||||||
if (s['type'] == 'int'):
|
if (s['type'] == 'int'):
|
||||||
default_num = int(s['default'])
|
try:
|
||||||
|
default_num = int(s['default'])
|
||||||
|
except ValueError:
|
||||||
|
default_num = int(float(s['default']))
|
||||||
else:
|
else:
|
||||||
default_num = float(s['default'])
|
default_num = float(s['default'])
|
||||||
output_stats += "{}={}={}\n".format(s['name'], s['type'], default_num)
|
output_stats += "{}={}={}\n".format(s['name'], s['type'], default_num)
|
||||||
|
Loading…
Reference in New Issue
Block a user