diff --git a/nodes/TileMapObject.gd b/nodes/TileMapObject.gd index f6f5b4b..59bc088 100644 --- a/nodes/TileMapObject.gd +++ b/nodes/TileMapObject.gd @@ -32,6 +32,8 @@ func _enter_tree() -> void: func _update_cell_size(_p_old_cell_size: Vector2, p_new_cell_size: Vector2) -> void: # We're assuming that all tile textures are of same dimensions. # todo: Diagnose mismatch by walking over all textures? + if tile_set.get_tiles_ids().size() == 0: + return var tileset_texture_size := tile_set.tile_get_texture(0).get_size() scale = p_new_cell_size / tileset_texture_size cell_size = p_new_cell_size / scale