fixed bug with overwriting variables by same named struct in MM engine
[rocksndiamonds.git] / src / game_mm / mm_game.c
index 4de58b82685bec2e28bdef152f38f30c16f217e7..97dc986b20ea1fba1c617dbffb010cb660319b5c 100644 (file)
@@ -292,9 +292,6 @@ void InitGameEngine_MM()
 {
   int i, x, y;
 
-  /* set global editor control values */
-  editor.draw_walls_masked = FALSE;
-
   /* set global game control values */
   game_mm.num_cycle = 0;
   game_mm.num_pacman = 0;
@@ -571,6 +568,10 @@ void ScanLaser()
   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;
+
   laser.overloaded = FALSE;
   laser.stops_inside_element = FALSE;
 
@@ -2444,6 +2445,10 @@ void ClickElement(int mx, int my, int button)
   int element;
   int x = (mx - SX) / TILEX, y = (my - SY) / TILEY;
 
+  /* do not rotate objects hit by the laser after the game was solved */
+  if (game_mm.level_solved && Hit[x][y])
+    return;
+
   if (button == MB_RELEASED)
   {
     new_button = TRUE;
@@ -2647,6 +2652,10 @@ void AutoRotateMirrors()
     {
       int element = Feld[x][y];
 
+      /* do not rotate objects hit by the laser after the game was solved */
+      if (game_mm.level_solved && Hit[x][y])
+       continue;
+
       if (IS_DF_MIRROR_AUTO(element) ||
          IS_GRID_WOOD_AUTO(element) ||
          IS_GRID_STEEL_AUTO(element) ||