mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-25 06:00:13 -05:00
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.
This commit is contained in:
+2
-2
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user