added not drawing or scanning laser if fuse is off in MM engine
authorHolger Schemel <info@artsoft.org>
Thu, 12 Jan 2023 08:54:39 +0000 (09:54 +0100)
committerHolger Schemel <info@artsoft.org>
Thu, 12 Jan 2023 08:54:39 +0000 (09:54 +0100)
src/game_mm/mm_game.c

index daec6fb77e4751ab8814235a3386658b75cb4bcd..571c9094240bd8b4a0019a50fcbc1ade8dc746c9 100644 (file)
@@ -948,6 +948,10 @@ void ScanLaser(void)
   if (game_mm.game_over)
     return;
 
+  // do not scan laser if fuse is off
+  if (laser.fuse_off)
+    return;
+
   DeactivateLaserTargetElement();
 
   laser.overloaded = FALSE;
@@ -1325,6 +1329,10 @@ static void DrawLaserExt(int start_edge, int num_edges, int mode)
 
 void DrawLaser(int start_edge, int mode)
 {
+  // do not draw laser if fuse is off
+  if (laser.fuse_off && mode == DL_LASER_ENABLED)
+    return;
+
   if (mode == DL_LASER_DISABLED)
     DeactivateLaserTargetElement();