From: Holger Schemel Date: Fri, 31 Mar 2023 14:09:18 +0000 (+0200) Subject: fixed handling laser when clicking on one of several McDuffins in MM engine X-Git-Tag: 4.3.5.3~10 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d9854779a9f8bfcf09cfab5905c257da10c61e5f;p=rocksndiamonds.git fixed handling laser when clicking on one of several McDuffins in MM engine --- diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index c5cfa1d5..6162d7a0 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -3088,29 +3088,25 @@ boolean ClickElement(int x, int y, int button) } else if (IS_MCDUFFIN(element)) { - if (!laser.fuse_off) - { - DrawLaser(0, DL_LASER_DISABLED); + boolean has_laser = (x == laser.start_edge.x && y == laser.start_edge.y); - /* - BackToFront(); - */ - } + if (has_laser && !laser.fuse_off) + DrawLaser(0, DL_LASER_DISABLED); element = get_rotated_element(element, BUTTON_ROTATION(button)); - laser.start_angle = get_element_angle(element); - - InitLaser(); Tile[x][y] = element; DrawField_MM(x, y); - /* - BackToFront(); - */ + if (has_laser) + { + laser.start_angle = get_element_angle(element); - if (!laser.fuse_off) - ScanLaser(); + InitLaser(); + + if (!laser.fuse_off) + ScanLaser(); + } element_clicked = TRUE; }