From a71e7d9c1ee4e7b6690041c3e4a305739760b246 Mon Sep 17 00:00:00 2001 From: FreezePhoenix <24441367+FreezePhoenix@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:29:33 -0500 Subject: [PATCH 1/2] Update server.js (Add 'compound_no_scroll' event to 'compound') Adds a 'compound_no_scroll' failure event to the 'compound' socket callback, instead of erroring. --- node/server.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/server.js b/node/server.js index 9efe6d6..e5dbde7 100644 --- a/node/server.js +++ b/node/server.js @@ -5692,6 +5692,9 @@ function init_io() { if (offering && G.items[offering.name].type != "offering") { return socket.emit("game_response", "compound_invalid_offering"); } + if (!scroll) { + return socket.emit("game_response", "compound_no_scroll"); + } if (!item0 || (item0.level || 0) != data.clevel) { return fail_response("no_item"); } From 4fa5bb98652fa2491f4b9f43f6c20d049ee16561 Mon Sep 17 00:00:00 2001 From: FreezePhoenix <24441367+FreezePhoenix@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:31:05 -0500 Subject: [PATCH 2/2] Update game.js (Add 'compound_no_scroll' event to 'compound') Adds a handler for the 'compound_no_scroll' to the client. --- js/game.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/game.js b/js/game.js index c10cfc7..2341574 100644 --- a/js/game.js +++ b/js/game.js @@ -1613,6 +1613,10 @@ function init_socket(args) ui_error("Item combination failed"); if(!data.stale) resolve_deferred("compound",{success:false,level:data.level,num:data.num}); } + else if(response=="compound_no_scroll") + { + reject_deferred("compound",{reason:"no_scroll"}); + } else if(response=="compound_in_progress") { ui_log("Another combination in progress","gray"); @@ -6182,4 +6186,4 @@ function draw(arg1,manual_draw) { catch(e){console.log(e);} } in_draw=false; -} \ No newline at end of file +}