Apply suggestions from code review

Fixing missing return attribute in doc
This commit is contained in:
David Négrier 2022-01-22 22:20:41 +01:00 committed by GitHub
parent dd03a2d1ff
commit d8327d1b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -175,7 +175,7 @@ WA.player.state.toto //will retrieve the variable
### Move player to position ### Move player to position
```typescript ```typescript
WA.player.moveTo(x: number, y: number, speed?: number): Promise<{ x: number, y: number }>; WA.player.moveTo(x: number, y: number, speed?: number): Promise<{ x: number, y: number, cancelled: boolean }>;
``` ```
Player will try to find shortest path to the destination point and proceed to move there. Player will try to find shortest path to the destination point and proceed to move there.
```typescript ```typescript

View file

@ -1462,7 +1462,6 @@ ${escapedMessage}
}); });
iframeListener.registerAnswerer("movePlayerTo", async (message) => { iframeListener.registerAnswerer("movePlayerTo", async (message) => {
// TODO: walk player to position, wait for promise to resolve
const index = this.getGameMap().getTileIndexAt(message.x, message.y); const index = this.getGameMap().getTileIndexAt(message.x, message.y);
const startTile = this.getGameMap().getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y); const startTile = this.getGameMap().getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y);
const path = await this.getPathfindingManager().findPath(startTile, index, true, true); const path = await this.getPathfindingManager().findPath(startTile, index, true, true);