Merge pull request #55 from FreezePhoenix/patch-5

Add 'compound_no_scroll' event to 'compound'
This commit is contained in:
Kaan Soral
2023-11-07 23:33:41 +03:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -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;
}
}
+3
View File
@@ -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");
}