diff --git a/packages/topdown/src/resources/tiles.js b/packages/topdown/src/resources/tiles.js index 4d5838d..f92d96f 100644 --- a/packages/topdown/src/resources/tiles.js +++ b/packages/topdown/src/resources/tiles.js @@ -215,8 +215,7 @@ export default (latus) => { tileAt([x, y]) { const [w, h] = this.size; - const index = y * w + x; - return x < 0 || x >= w || y < 0 || y >= h ? undefined : this.data[index]; + return x < 0 || x >= w || y < 0 || y >= h ? undefined : this.data[y * w + x]; } toNetwork() {