From 17f14504b0c798813a4fef04dcdaaa90b73d5d0f Mon Sep 17 00:00:00 2001 From: Niceygy Date: Thu, 9 Nov 2023 16:41:14 +0000 Subject: [PATCH] Fix return value in load function and add logLineCount variable in mainGameLoop --- game.py | 2 +- main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/game.py b/game.py index 8c549d3..6eca5d8 100644 --- a/game.py +++ b/game.py @@ -56,7 +56,7 @@ def load(logDir): except json.JSONDecodeError: log(f"Skipping line: {line}", "load") res.reverse() # so that it will stop when at the latest event it recognizes - return res + return res, len(res) def getCMDR(logs): diff --git a/main.py b/main.py index 634b94c..e422741 100644 --- a/main.py +++ b/main.py @@ -93,7 +93,7 @@ def mainGameLoop(): j = 0 while j < len(logs): logLineNow = logs[j] - now = eventHandler(logLineNow["event"], j) + now, logLineCount = eventHandler(logLineNow["event"], j) log("Event: " + str(now) + " No: " + str(j), "mainGameLoop") j += 1 if now != 1: