diff --git a/package-lock.json b/package-lock.json index 6d9a2bc..710122d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "diabloweb", - "version": "1.0.33", + "version": "1.0.34", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0f59d22..a630b0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "diabloweb", - "version": "1.0.33", + "version": "1.0.34", "private": true, "dependencies": { "@babel/core": "7.4.3", diff --git a/src/App.js b/src/App.js index 6da8f58..1e44be5 100644 --- a/src/App.js +++ b/src/App.js @@ -19,7 +19,7 @@ if (process.env.NODE_ENV === 'production') { } function reportLink(e, retail) { - const message = e.stack || e.message || "Unknown error"; + const message = (e.message || "Unknown error") + (e.stack ? "\n" + e.stack : ""); const url = new URL("https://github.com/d07RiV/diabloweb/issues/new"); url.searchParams.set("body", `**Description:** diff --git a/src/api/game.worker.js b/src/api/game.worker.js index 4f12bc3..a1ccda0 100644 --- a/src/api/game.worker.js +++ b/src/api/game.worker.js @@ -287,9 +287,12 @@ function try_api(func) { function call_api(func, ...params) { try_api(() => { - audioBatch = []; - audioTransfer = []; - packetBatch = []; + const nested = (audioBatch != null); + if (!nested) { + audioBatch = []; + audioTransfer = []; + packetBatch = []; + } if (func !== "text") { wasm["_" + func](...params); } else { @@ -303,16 +306,18 @@ function call_api(func, ...params) { heap[ptr + length] = 0; wasm._DApi_SyncText(params[1]); } - if (audioBatch.length) { - maxSoundId = maxBatchId; - worker.postMessage({action: "audioBatch", batch: audioBatch}, audioTransfer); + if (!nested) { + if (audioBatch.length) { + maxSoundId = maxBatchId; + worker.postMessage({action: "audioBatch", batch: audioBatch}, audioTransfer); + } + if (packetBatch.length) { + worker.postMessage({action: "packetBatch", batch: packetBatch}, packetBatch); + } + audioBatch = null; + audioTransfer = null; + packetBatch = null; } - if (packetBatch.length) { - worker.postMessage({action: "packetBatch", batch: packetBatch}, packetBatch); - } - audioBatch = null; - audioTransfer = null; - packetBatch = null; }); }