summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/graphics.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/graphics.rs b/src/graphics.rs
index 8ccdbd3..9af03f4 100644
--- a/src/graphics.rs
+++ b/src/graphics.rs
@@ -87,6 +87,12 @@ impl Graphics {
for layer in &state.map.layers {
let tmx_tile = layer.tiles[y as usize][x as usize];
+
+ // blank tile
+ if tmx_tile <= 0 {
+ continue;
+ }
+
let tmx_tileset = state.map.get_tileset_by_gid(tmx_tile).unwrap();
// load tileset if not loaded yet