diff --git a/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/SaveHandler.java b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/SaveHandler.java index ac17fbe..9c6419e 100644 --- a/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/SaveHandler.java +++ b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/SaveHandler.java @@ -16,7 +16,7 @@ public static void processFinishing(VisualNovelEngine vn) { vn.variables.put("time", getCurrentDateTime()); vn.saves.add(vn.variables); } - ScriptLoader.saveGlobal(vn.variables,vn.uid.toString()); + ScriptLoader.saveGlobal(vn.saves,vn.uid.toString()); vn.shutdown.set(true); } diff --git a/src/main/java/org/arsparadox/mobtalkerredux/vn/model/ScriptLoader.java b/src/main/java/org/arsparadox/mobtalkerredux/vn/model/ScriptLoader.java index fe5005a..ec76db9 100644 --- a/src/main/java/org/arsparadox/mobtalkerredux/vn/model/ScriptLoader.java +++ b/src/main/java/org/arsparadox/mobtalkerredux/vn/model/ScriptLoader.java @@ -133,7 +133,7 @@ public static List> loadSave(String fileName, String playerU public static List> loadGlobal(String playerUID) { // Try loading from the save folder (level or player UID folder) - String fileName = "global"; + String fileName = "global.json"; File saveFile = new File(getSaveFilePath(fileName, playerUID,getWorldName())); if (saveFile.exists()) { System.out.println("Loading from save folder: " + fileName); @@ -159,9 +159,9 @@ public static void saveState(List> gameState, String fileNam } } - public static void saveGlobal(Map save, String playerName) { + public static void saveGlobal(List> save, String playerName) { playerName = playerName.toLowerCase(); - String filePath = getSaveFilePath("global", playerName,getWorldName()); + String filePath = getSaveFilePath("global.json", playerName,getWorldName()); try (Writer writer = new FileWriter(filePath)) { gson.toJson(save, writer); } catch (IOException e) {