From 1e815e7f52b18b1cb606689678d49b289410b219 Mon Sep 17 00:00:00 2001 From: ebolam Date: Fri, 1 Jul 2022 18:08:45 -0400 Subject: [PATCH] Fix for action count on new version of save file --- fileops.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fileops.py b/fileops.py index c303764e..d8dc552c 100644 --- a/fileops.py +++ b/fileops.py @@ -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