From 7047899f357847c21801eb6e2c6c338a3aee5d4d Mon Sep 17 00:00:00 2001 From: yuki Date: Tue, 18 Nov 2025 12:28:14 -0300 Subject: [PATCH] remove redundant atlas id code --- scenes/tilemaps/block_tile_layer.gd | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scenes/tilemaps/block_tile_layer.gd b/scenes/tilemaps/block_tile_layer.gd index dce0e69..6a7dd69 100644 --- a/scenes/tilemaps/block_tile_layer.gd +++ b/scenes/tilemaps/block_tile_layer.gd @@ -5,7 +5,6 @@ signal block_hit(tile_pos: Vector2i, hits_left: int) signal block_destroyed(tile_pos: Vector2i) ## Atlas in which the destructable blocks are stored. -@export var block_source_id: int = 4 @export var max_hits: int = 4 var hit_counts: Dictionary[Vector2i, int] = {} @@ -14,8 +13,6 @@ var hit_counts: Dictionary[Vector2i, int] = {} ## Returns true if block is destroyed. func hit_tile(coords: Vector2i) -> bool: var source_id: int = get_cell_source_id(coords) - if source_id != block_source_id: - return false # not destructible var current_atlas: Vector2i = get_cell_atlas_coords(coords) var row: int = current_atlas.y @@ -31,7 +28,7 @@ func hit_tile(coords: Vector2i) -> bool: else: # damage var new_atlas: Vector2i = Vector2i(hits, row) # column=hits, row=same color - set_cell(coords, block_source_id, new_atlas) + set_cell(coords, source_id, new_atlas) hit_counts[coords] = hits block_hit.emit(coords, max_hits - hits) return false