From: Holger Schemel Date: Wed, 19 Aug 2020 22:55:32 +0000 (+0200) Subject: fixed support for wrap-around levels in EM engine for old tapes X-Git-Tag: 4.2.0.1^0 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=04c0f30221267649e3c1098270eda66272fce40e;p=rocksndiamonds.git fixed support for wrap-around levels in EM engine for old tapes When playing tapes that solved wrap-around levels with the EM engine that were recorded before wrap-around support was added, deactivate wrap-around to not break old tapes. --- diff --git a/src/game.c b/src/game.c index d67a91a0..8c243a49 100644 --- a/src/game.c +++ b/src/game.c @@ -2991,6 +2991,9 @@ static void InitGameEngine(void) game_em.use_old_explosions = (game.engine_version < VERSION_IDENT(4,1,4,2)); + game_em.use_wrap_around = + (game.engine_version > VERSION_IDENT(4,1,4,1)); + // -------------------------------------------------------------------------- // set maximal allowed number of custom element changes per game frame diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 6b09ece6..bae0130c 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -459,6 +459,7 @@ void prepare_em_level(void) // - game_em.use_single_button (default: TRUE) // - game_em.use_snap_key_bug (default: FALSE) // - game_em.use_old_explosions (default: FALSE) + // - game_em.use_wrap_around (default: TRUE) game_em.level_solved = FALSE; game_em.game_over = FALSE; diff --git a/src/game_em/export.h b/src/game_em/export.h index 4766101b..e1519ea6 100644 --- a/src/game_em/export.h +++ b/src/game_em/export.h @@ -46,6 +46,7 @@ struct GameInfo_EM boolean use_single_button; boolean use_snap_key_bug; boolean use_old_explosions; + boolean use_wrap_around; }; struct LevelInfo_EM diff --git a/src/game_em/reademc.c b/src/game_em/reademc.c index 3f366227..1308615c 100644 --- a/src/game_em/reademc.c +++ b/src/game_em/reademc.c @@ -293,7 +293,7 @@ void convert_em_level(unsigned char *src, int file_version) cav.time_seconds = MIN(GET_BE16(src[2110]), 9999); cav.gems_needed = src[2095]; - cav.infinite = TRUE; + cav.infinite = game_em.use_wrap_around; cav.testmode = FALSE; cav.teamwork = (src[2150] & 128) != 0;