From 35ea81b5029a97d1be1e23e981ed76aabfed5aae Mon Sep 17 00:00:00 2001 From: Yorick van Klinken Date: Sat, 29 Jun 2024 18:48:47 +0200 Subject: [PATCH] fix: getTile return type should include null (#3112) --- src/engine/TileMap/TileMap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/TileMap/TileMap.ts b/src/engine/TileMap/TileMap.ts index 57dcdb081..aca92972d 100644 --- a/src/engine/TileMap/TileMap.ts +++ b/src/engine/TileMap/TileMap.ts @@ -468,7 +468,7 @@ export class TileMap extends Entity { * For example, if I want the tile in fifth column (x), and second row (y): * `getTile(4, 1)` 0 based, so 0 is the first in row/column */ - public getTile(x: number, y: number): Tile { + public getTile(x: number, y: number): Tile | null { if (x < 0 || y < 0 || x >= this.columns || y >= this.rows) { return null; }