From 322edad0912bd481c67938a16ef889bb2532d3a7 Mon Sep 17 00:00:00 2001 From: Joey Thomas Date: Sun, 13 May 2018 21:14:52 +0100 Subject: [PATCH] Stop item movement on out-of-bounds error * Instead of throwing an error, just stop the movement of the item and run the callback when it tries to go out-of-bounds with the ARRIVED_NEAR error code. This prevents location loading issues when the GS resumes item movement in `Item.gsOnLoad` (specifically Yoga frogs). --- src/model/ItemMovement.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/model/ItemMovement.js b/src/model/ItemMovement.js index ccb136e8..4a182a73 100644 --- a/src/model/ItemMovement.js +++ b/src/model/ItemMovement.js @@ -776,7 +776,8 @@ ItemMovement.prototype.moveStep = function moveStep() { var nextStep = this.transport(this.path[0]); if (nextStep && !nextStep.forceStop) { if (nextStep.dx < this.getGeo().l || nextStep.dx > this.getGeo().r) { - throw new NpcMovementError(this, 'step destination out of bounds'); + log.warn('movement: step destination out of bounds for %s', this.item); + return this.stopMove(MOVE_CB_STATUS.ARRIVED_NEAR); } // actually move and announce the resulting changes this.item.setXY(nextStep.dx, nextStep.dy);