diff options
| author | ne_mene <[email protected]> | 2026-03-13 17:52:50 +0100 |
|---|---|---|
| committer | ne_mene <[email protected]> | 2026-03-13 17:52:50 +0100 |
| commit | bc52ad3e36ecb0918eca17ea68a0dc54852a3392 (patch) | |
| tree | bc3f47ab2619b08ba15fa593a625c9f4269e0b26 /src/objs/tilemap.lua | |
| parent | c11b02ac27e68a218ea80826765cd1631e95e6d0 (diff) | |
player is fat, ha ha
Diffstat (limited to 'src/objs/tilemap.lua')
| -rw-r--r-- | src/objs/tilemap.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/objs/tilemap.lua b/src/objs/tilemap.lua index 8b1ab76..7904a19 100644 --- a/src/objs/tilemap.lua +++ b/src/objs/tilemap.lua @@ -133,6 +133,13 @@ function get_tile(map, x, y) return map.tiledata[ID(map, x, y)] end +function has_tile(map, x, y) + if x < 0 or x >= map.width or y < 0 or y >= map.height then + return false + end + return map.tiledata[ID(map, x, y)] ~= 0 +end + function queue_tilemap_rebuild(tilemap) tilemap.needs_rebuild = true end |
