changed level time units from 4-second-intervals to seconds (MM engine)
authorHolger Schemel <info@artsoft.org>
Mon, 10 Apr 2017 21:22:07 +0000 (23:22 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:12 +0000 (23:21 +0100)
src/game_mm/mm_files.c
src/game_mm/mm_game.c

index 31e566335f4aa9ae9f106bcee46731457d48d95d..8e6a72bdf761cee3e3ff78b75fd40c95c638765c 100644 (file)
@@ -151,6 +151,10 @@ static int LoadLevel_MM_HEAD(File *file, int chunk_size,
   level->time           = getFile16BitInteger(file, BYTE_ORDER_BIG_ENDIAN);
   level->kettles_needed = getFile16BitInteger(file, BYTE_ORDER_BIG_ENDIAN);
 
+  // one time unit was equivalent to four seconds in level files up to 2.0.x
+  if (level->file_version <= MM_FILE_VERSION_2_0)
+    level->time *= 4;
+
   for (i = 0; i < MAX_LEVEL_NAME_LEN; i++)
     level->name[i] = getFile8Bit(file);
   level->name[MAX_LEVEL_NAME_LEN] = 0;
index 8b0ba849abda46977749aaa6f9e3dd38c9f0791f..543be639102099ba2c1f5bad4e9d52e62e972476 100644 (file)
@@ -73,7 +73,7 @@
 #define INIT_GAME_ACTIONS_DELAY        (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
 #define NUM_INIT_CYCLE_STEPS   16
 #define PACMAN_MOVE_DELAY      12
-#define ENERGY_DELAY           (4 * ONE_SECOND_DELAY / GAME_FRAME_DELAY)
+#define ENERGY_DELAY           (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
 #define HEALTH_DEC_DELAY       3
 #define HEALTH_INC_DELAY       9
 #define HEALTH_DELAY(x)                ((x) ? HEALTH_DEC_DELAY : HEALTH_INC_DELAY)