throw an exception if no path found when using player.moveTo command. Cancelling path following no longer rejects the promise
This commit is contained in:
@@ -1467,6 +1467,9 @@ ${escapedMessage}
|
||||
const startTile = this.getGameMap().getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y);
|
||||
const path = await this.getPathfindingManager().findPath(startTile, index, true, true);
|
||||
path.shift();
|
||||
if (path.length === 0) {
|
||||
throw new Error("no path available");
|
||||
}
|
||||
return this.CurrentPlayer.setPathToFollow(path, message.speed);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user