1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 07:43:01 +01:00

Resolve issues with save before load/quit prompt

This commit is contained in:
Ethan O'Brien
2025-08-10 14:30:26 -05:00
parent 1eff246b1a
commit a784fe46fe
3 changed files with 10 additions and 9 deletions

View File

@@ -21,14 +21,13 @@ var EmscriptenDeps = {
return data;
}
},
EmscriptenSaveGame: async (isTrackDesign, isAutosave, isSaveAs, type) => {
EmscriptenSaveGame: async (isTrackDesign, isAutosave, type) => {
isTrackDesign = isTrackDesign === 1;
isAutosave = isAutosave === 1;
isSaveAs = isSaveAs === 1;
const data = SAVE.readFileData(isTrackDesign);
try {
if (window.showSaveFilePicker) {
if (SAVE.filehandle === null || isSaveAs) {
if (SAVE.filehandle === null) {
SAVE.filehandle = null;
const file = await showSaveFilePicker({
id: "OpenRCT2-" + type,
@@ -75,7 +74,6 @@ var EmscriptenDeps = {
EmscriptenLoadGame: async (type) => {
try {
if (window.showOpenFilePicker) {
SAVE.filehandle = null;
const [file] = await showOpenFilePicker({
id: "OpenRCT2-" + type,
types: [