moved code to separate function
authorHolger Schemel <info@artsoft.org>
Tue, 21 Jan 2025 18:15:46 +0000 (19:15 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 21 Jan 2025 17:16:25 +0000 (18:16 +0100)
src/game.c

index 7215d695d5618649aa4e38c8d1540a5a82c3f277..a47129c71ef04b6283af77326eb89d2140e8fb1c 100644 (file)
@@ -5027,6 +5027,17 @@ void InitAmoebaNr(int x, int y)
   AmoebaCnt2[group_nr]++;
 }
 
+static void LevelSolved_UpdateFinalGameValues(int time, int score, int health)
+{
+  game.LevelSolved_CountingTime = time;
+  game.LevelSolved_CountingScore = score;
+  game.LevelSolved_CountingHealth = health;
+
+  game_panel_controls[GAME_PANEL_TIME].value = time;
+  game_panel_controls[GAME_PANEL_SCORE].value = score;
+  game_panel_controls[GAME_PANEL_HEALTH].value = health;
+}
+
 static void LevelSolved_SetFinalGameValues(void)
 {
   game.time_final = (level.game_engine_type == GAME_ENGINE_TYPE_BD ? game_bd.time_left :
@@ -5051,13 +5062,7 @@ static void LevelSolved_SetFinalGameValues(void)
 
 static void LevelSolved_DisplayFinalGameValues(int time, int score, int health)
 {
-  game.LevelSolved_CountingTime = time;
-  game.LevelSolved_CountingScore = score;
-  game.LevelSolved_CountingHealth = health;
-
-  game_panel_controls[GAME_PANEL_TIME].value = time;
-  game_panel_controls[GAME_PANEL_SCORE].value = score;
-  game_panel_controls[GAME_PANEL_HEALTH].value = health;
+  LevelSolved_UpdateFinalGameValues(time, score, health);
 
   DisplayGameControlValues();
 }