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:
parent
ef02a06ad7
commit
62b00f852d
6 changed files with 26 additions and 26 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue