moved handling game over condition from MM game engine to main engine
[rocksndiamonds.git] / src / game_mm / mm_game.c
index 1542db1a16da1a34e6b111d7fca4ff754d45799b..d57c5a3b0911f66ff6f1f05ee6bfcf734b23fd52 100644 (file)
@@ -570,6 +570,8 @@ static void InitField(int x, int y, boolean init_game)
           game_mm.laser_green = native_mm_level.df_laser_green;
           game_mm.laser_blue  = native_mm_level.df_laser_blue;
         }
+
+       game_mm.has_mcduffin = (IS_MCDUFFIN(element));
       }
 
       break;
@@ -662,10 +664,12 @@ void InitGameEngine_MM(void)
   game_mm.laser_red = FALSE;
   game_mm.laser_green = FALSE;
   game_mm.laser_blue = TRUE;
+  game_mm.has_mcduffin = TRUE;
 
   game_mm.level_solved = FALSE;
   game_mm.game_over = FALSE;
   game_mm.game_over_cause = 0;
+  game_mm.game_over_message = NULL;
 
   game_mm.laser_overload_value = 0;
   game_mm.laser_enabled = FALSE;
@@ -802,25 +806,15 @@ static void FadeOutLaser(void)
 
 static void GameOver_MM(int game_over_cause)
 {
-  // do not handle game over if request dialog is already active
-  if (game.request_active)
-    return;
-
   game_mm.game_over = TRUE;
   game_mm.game_over_cause = game_over_cause;
-
-  // do not ask to play again if game was never actually played
-  if (!game.GamePlayed)
-    return;
-
-  if (setup.ask_on_game_over)
-    game.restart_game_message = (game_over_cause == GAME_OVER_BOMB ?
-                                "Bomb killed Mc Duffin! Play it again?" :
-                                game_over_cause == GAME_OVER_NO_ENERGY ?
-                                "Out of magic energy! Play it again?" :
-                                game_over_cause == GAME_OVER_OVERLOADED ?
-                                "Magic spell hit Mc Duffin! Play it again?" :
-                                NULL);
+  game_mm.game_over_message = (game_over_cause == GAME_OVER_BOMB ?
+                              "Bomb killed Mc Duffin!" :
+                              game_over_cause == GAME_OVER_NO_ENERGY ?
+                              "Out of magic energy!" :
+                              game_over_cause == GAME_OVER_OVERLOADED ?
+                              "Magic spell hit Mc Duffin!" :
+                              NULL);
 
   SetTileCursorActive(FALSE);
 }