From 62a65f599d6f247f000686a572615580a30ab483 Mon Sep 17 00:00:00 2001 From: Matteo Benedetto Date: Tue, 16 Jun 2026 21:56:22 +0200 Subject: [PATCH] Draw explosions and gas inside tunnel cells Remove the is_hidden_in_tunnel() checks from Explosion.draw() and Gas.draw() so explosions and gas clouds remain visible when their center falls inside a tunnel cell. Logic already spawned them in tunnel cells, but they were rendered invisible because the draw path returned early. --- units/bomb.py | 3 --- units/gas.py | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/units/bomb.py b/units/bomb.py index 8293858..de884fc 100644 --- a/units/bomb.py +++ b/units/bomb.py @@ -169,9 +169,6 @@ class Explosion(Bomb): x_pos = self.position_before[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2 + partial_x y_pos = self.position_before[1] * self.game.cell_size + (self.game.cell_size - image_size[1]) // 2 + partial_y - if self.is_hidden_in_tunnel(image_size): - return - self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit") diff --git a/units/gas.py b/units/gas.py index 30fa018..5530cb5 100644 --- a/units/gas.py +++ b/units/gas.py @@ -75,10 +75,8 @@ class Gas(Unit): x_pos = self.position_before[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2 + partial_x y_pos = self.position_before[1] * self.game.cell_size + (self.game.cell_size - image_size[1]) // 2 + partial_y - if not self.is_hidden_in_tunnel(image_size): - self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit") + self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit") for cell in self.spreading_cells: x_pos = cell[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2 + partial_x y_pos = cell[1] * self.game.cell_size + (self.game.cell_size - image_size[1]) // 2 + partial_y - if not self.is_hidden_in_tunnel(image_size, position=cell): - self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit") + self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit")