Fix for action count on new version of save file

This commit is contained in:
ebolam
2022-07-01 18:08:45 -04:00
parent 0161966cea
commit 1e815e7f52

View File

@@ -96,11 +96,18 @@ def getstoryfiles():
f.close()
continue
f.close()
try:
ob["actions"] = len(js["actions"])
except TypeError:
print(f"Browser loading error: {file} has incorrect format.")
continue
if 'file_version' in js:
try:
ob["actions"] = int(js["actions"]["action_count"])+1
except TypeError:
print(f"Browser loading error: {file} has incorrect format.")
continue
else:
try:
ob["actions"] = len(js["actions"])
except TypeError:
print(f"Browser loading error: {file} has incorrect format.")
continue
list.append(ob)
return list