From 92d2016c6177301040aed44a821cd30c7f44751e Mon Sep 17 00:00:00 2001 From: FreezePhoenix <24441367+FreezePhoenix@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:02:18 -0500 Subject: [PATCH] Fix skill cooldown promise issues When Earthiverse made their changes to the skill system, they inadvertently change a piece of the code that made it so that when a skill was attempted to be used on cooldown, the response would be sent with `place: "skill"`, and the result would be a hung promise, as the client is waiting for a `place: "curse"`, or some other `place` value, depending on the skill they used. --- node/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/server.js b/node/server.js index 0af98d6..dbd3838 100644 --- a/node/server.js +++ b/node/server.js @@ -8085,7 +8085,7 @@ function init_io() { lastUse = player.last[data.name]; } if (cooldown && lastUse && mssince(lastUse) < cooldown) { - return fail_response("cooldown", { + return fail_response("cooldown", data.name, { skill: data.name, id: data.id, ms: cooldown - mssince(lastUse), @@ -8204,7 +8204,7 @@ function init_io() { const dist = distance(player, target); if (dist > range + player.xrange) { - return fail_response("too_far", data.name, { dist: dist, id: target.id, place: data.name }); + return fail_response("too_far", data.name, { dist: dist, id: target.id }); } if (dist > range) { // xrange was used, reduce it by however much we used