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
|
@ -15,17 +15,15 @@
|
|||
|
||||
randomChainedMovementButton.addEventListener('click', async () => {
|
||||
try {
|
||||
let pos;
|
||||
pos = await WA.player.moveTo(100, 100, 10);
|
||||
console.log(pos);
|
||||
pos = await WA.player.moveTo(500, 100, 10);
|
||||
console.log(pos);
|
||||
pos = await WA.player.moveTo(500, 500, 10);
|
||||
console.log(pos);
|
||||
pos = await WA.player.moveTo(100, 500, 10);
|
||||
console.log(pos);
|
||||
pos = await WA.player.moveTo(100, 100, 10);
|
||||
console.log(pos);
|
||||
WA.player.moveTo(100, 100, 10).then((result) => {
|
||||
console.log(result);
|
||||
WA.player.moveTo(500, 100, 20).then((result) => {
|
||||
console.log(result);
|
||||
WA.player.moveTo(500, 500, 10).then((result) => {
|
||||
console.log(result);
|
||||
});
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
console.log('movement was stopped forcefully');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue