fix for real

This commit is contained in:
Detanup01 2024-05-17 21:48:51 +02:00 committed by GitHub
parent ea1bb239c3
commit 435f9bfd49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,8 @@ def generate_stats_achievements(
out = {} out = {}
out['default'] = 0 out['default'] = 0
out['name'] = stat['name'] out['name'] = stat['name']
if 'min' in stat:
out['min'] = stat['min']
if stat['type'] == STAT_TYPE_INT: if stat['type'] == STAT_TYPE_INT:
out['type'] = 'int' out['type'] = 'int'
elif stat['type'] == STAT_TYPE_FLOAT: elif stat['type'] == STAT_TYPE_FLOAT:
@ -99,7 +101,10 @@ def generate_stats_achievements(
except ValueError: except ValueError:
# we set this to min if someone is failed to set to a fucking int value. and after this and still throwing error I gonna throw the dev out of the windows whoever misstyped that!!! # we set this to min if someone is failed to set to a fucking int value. and after this and still throwing error I gonna throw the dev out of the windows whoever misstyped that!!!
# fixes 282800 | STAT_OJ46_C12 (<---THIS ONE) # fixes 282800 | STAT_OJ46_C12 (<---THIS ONE)
default_num = int(s['min']) if 'min' in s:
default_num = int(s['min'])
else:
raise ValueError('min not exist in (s) and no way to get the data. please report with the appid')
else: else:
default_num = float(s['default']) default_num = float(s['default'])
output_stats.append(f"{s['name']}={s['type']}={default_num}\n") output_stats.append(f"{s['name']}={s['type']}={default_num}\n")