From: Holger Schemel Date: Thu, 12 Jan 2023 08:46:12 +0000 (+0100) Subject: moved code to deactivate target element to separate function in MM engine X-Git-Tag: 4.3.5.0~44 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=75a80bb5e95a67ae6343e15e8b835056b6862615;p=rocksndiamonds.git moved code to deactivate target element to separate function in MM engine --- diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 0a3effca..c9712c9b 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -916,15 +916,8 @@ static int ScanPixel(void) return hit_mask; } -void ScanLaser(void) +static void DeactivateLaserTargetElement(void) { - int element; - int end = 0, rf = laser.num_edges; - - // do not scan laser again after the game was lost for whatever reason - if (game_mm.game_over) - return; - if (laser.dest_element_last == EL_BOMB_ACTIVE || laser.dest_element_last == EL_MINE_ACTIVE || laser.dest_element_last == EL_GRAY_BALL_OPENING) @@ -944,6 +937,18 @@ void ScanLaser(void) laser.dest_element_last_x = -1; laser.dest_element_last_y = -1; } +} + +void ScanLaser(void) +{ + int element; + int end = 0, rf = laser.num_edges; + + // do not scan laser again after the game was lost for whatever reason + if (game_mm.game_over) + return; + + DeactivateLaserTargetElement(); laser.overloaded = FALSE; laser.stops_inside_element = FALSE;