fixed playing older tapes for MM engine
authorHolger Schemel <info@artsoft.org>
Sun, 22 Jan 2023 10:40:28 +0000 (11:40 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 22 Jan 2023 10:40:28 +0000 (11:40 +0100)
src/game_mm/export.h
src/game_mm/mm_game.c
src/game_mm/mm_tools.c

index b628a8d04c3b16ae3cee8b7479bd175abacaf173..2af2b0ea0536e9efef7f72f780981d320076fcfd 100644 (file)
@@ -143,6 +143,8 @@ struct GameInfo_MM
   int ball_choice_pos;         // current content element choice position
   boolean laser_red, laser_green, laser_blue;
 
+  boolean lightball_rnd;
+
   boolean level_solved;
   boolean game_over;
   int game_over_cause;
index 326880f16fccad8a3e8e5c83c6cb8d27a110e4fb..8583a9a7d7d056e43e13b3e2bcc80ffefe35af3a 100644 (file)
@@ -644,6 +644,8 @@ void InitGameEngine_MM(void)
   game_mm.laser_green = FALSE;
   game_mm.laser_blue = TRUE;
 
+  game_mm.lightball_rnd = TRUE;
+
   game_mm.level_solved = FALSE;
   game_mm.game_over = FALSE;
   game_mm.game_over_cause = 0;
@@ -714,6 +716,8 @@ void InitGameActions_MM(void)
 
   InitLaser();
 
+  game_mm.lightball_rnd = FALSE;
+
   for (i = 0; i <= num_init_game_frames; i++)
   {
     if (i == num_init_game_frames)
@@ -749,6 +753,8 @@ void InitGameActions_MM(void)
 #endif
   }
 
+  game_mm.lightball_rnd = TRUE;
+
   ScanLaser();
 
   if (game_mm.kettles_still_needed == 0)
index d8dbe8becaa5270253801ca4a406f0255f8d1aa3..44fb257c855cea163f2f250e47083d2a9df7a653 100644 (file)
@@ -398,6 +398,11 @@ void DrawField_MM(int x, int y)
   int element = Tile[x][y];
 
   DrawElement_MM(x, y, element);
+
+  // old game versions randomly changed colors of bonus light balls
+  if (game.engine_version < VERSION_IDENT(4,3,3,0) &&
+      element == EL_LIGHTBALL && game_mm.lightball_rnd)
+    RND(3);
 }
 
 void DrawLevel_MM(void)