Merge pull request #76 from FreezePhoenix/patch-7

Fix skill cooldown promise issues
This commit is contained in:
Kaan Soral
2023-12-09 23:56:11 +03:00
committed by GitHub
+2 -2
View File
@@ -8085,7 +8085,7 @@ function init_io() {
lastUse = player.last[data.name]; lastUse = player.last[data.name];
} }
if (cooldown && lastUse && mssince(lastUse) < cooldown) { if (cooldown && lastUse && mssince(lastUse) < cooldown) {
return fail_response("cooldown", { return fail_response("cooldown", data.name, {
skill: data.name, skill: data.name,
id: data.id, id: data.id,
ms: cooldown - mssince(lastUse), ms: cooldown - mssince(lastUse),
@@ -8204,7 +8204,7 @@ function init_io() {
const dist = distance(player, target); const dist = distance(player, target);
if (dist > range + player.xrange) { 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) { if (dist > range) {
// xrange was used, reduce it by however much we used // xrange was used, reduce it by however much we used