From bc1c220fdab991660624d116ce9b17b7e479b71e Mon Sep 17 00:00:00 2001 From: Varg Date: Sun, 29 Sep 2024 01:17:06 +0200 Subject: [PATCH] Don't show an error if error code is undefined --- src/lib/qsp-api.ts | 3 ++- src/qsplib/public/qsp-engine-debug.wasm | Bin 2443993 -> 2443998 bytes src/qsplib/public/qsp-engine-debug.wasm.map | 2 +- src/qsplib/public/qsp-engine.wasm | Bin 707101 -> 707105 bytes src/qsplib/src/qsp_wasm.c | 2 +- tests/variables.test.ts | 2 +- 6 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/qsp-api.ts b/src/lib/qsp-api.ts index 112d536..3cf7095 100644 --- a/src/lib/qsp-api.ts +++ b/src/lib/qsp-api.ts @@ -315,7 +315,8 @@ export class QspAPIImpl implements QspAPI { const ptr = allocErrorInfoPointer(this.module); this.module._getLastError(ptr); const error = readError(this.module, ptr); - this.emit('error', error); + if (error.errorCode > 0) + this.emit('error', error); this.module._free(ptr); }; diff --git a/src/qsplib/public/qsp-engine-debug.wasm b/src/qsplib/public/qsp-engine-debug.wasm index 496f0ed6f2066c9b9b8ae2bb4be3a74b2b1e3c20..d5bea6e33d6ffdfcd37f4ce11d4ce50038287b6a 100755 GIT binary patch delta 188 zcmWN=yA6Us0D$3~Ac&wK56}05M|A_(*j&vJSi6RW6A-pACKQa|3^op6t)+?omweB< z7BAi_DL(Be)L(tf^!6^Pk@m>q~YfS7ap`3^2WM*tj~BB}rY delta 85 zcmZ2DMSJcP?G1}r7*91XVQF8&!U)7nK+FupEZdi`u- { + test('global variables get restored if ONGSAVE calls goto', () => { const onSaveGame = vi.fn((_, callback) => { api.saveGame(); callback(); }); api.on('save_game', onSaveGame);