From 398f2c5be067a903429401b40d191302b226155f Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 15 Apr 2024 10:35:57 -0400 Subject: [PATCH] Fix being able to overwrite data without a confirmation --- src/ui/save-slot-select-ui-handler.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/save-slot-select-ui-handler.ts b/src/ui/save-slot-select-ui-handler.ts index 054bb1ab9f9..21865045141 100644 --- a/src/ui/save-slot-select-ui-handler.ts +++ b/src/ui/save-slot-select-ui-handler.ts @@ -114,8 +114,10 @@ export default class SaveSlotSelectUiHandler extends MessageUiHandler { ui.showText(null, 0); }, false, 0, 19, 2000); }); - } else + } else if (this.sessionSlots[this.cursor].hasData === false) saveAndCallback(); + else + return false; break; } success = true; @@ -210,7 +212,6 @@ class SessionSlot extends Phaser.GameObjects.Container { super(scene, 0, slotId * 56); this.slotId = slotId; - this.hasData = false; this.setup(); } @@ -282,6 +283,7 @@ class SessionSlot extends Phaser.GameObjects.Container { return new Promise(resolve => { this.scene.gameData.getSession(this.slotId).then(async sessionData => { if (!sessionData) { + this.hasData = false; this.loadingLabel.setText('Empty'); resolve(false); return;