diff --git a/data/GameManager.js b/data/GameManager.js index 01c1abf..b05f407 100644 --- a/data/GameManager.js +++ b/data/GameManager.js @@ -134,10 +134,8 @@ class EJS_GameManager { this.functions.restart(); } getState() { - return new Promise(async (resolve, reject) => { - this.functions.saveStateInfo(); - resolve(this.FS.readFile("/current.state")); - }) + this.functions.saveStateInfo(); + return this.FS.readFile("/current.state"); } loadState(state) { try { diff --git a/data/emulator.js b/data/emulator.js index 9beee24..0e08ebb 100644 --- a/data/emulator.js +++ b/data/emulator.js @@ -1715,7 +1715,7 @@ class EmulatorJS { let stateUrl; const saveState = addButton("Save State", '', async () => { - const state = await this.gameManager.getState(); + const state = this.gameManager.getState(); const called = this.callEvent("save", { screenshot: await this.gameManager.screenshot(), state: state @@ -4598,7 +4598,7 @@ class EmulatorJS { syncing = true; if (this.debug) console.log("sync") this.netplay.ready = 0; - const state = await this.gameManager.getState(); + const state = this.gameManager.getState(); this.netplay.sendMessage({ state: state });