From: Holger Schemel Date: Mon, 27 Apr 2020 21:29:15 +0000 (+0200) Subject: fixed element property that caused levels/tapes to be unsolvable X-Git-Tag: 4.2.0.0~34 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=5d264f3e98c7e526922ea961b85d558246fa14f4 fixed element property that caused levels/tapes to be unsolvable This fixes a bug introduced in version 2.0.1 that broke already existing levels and tapes, and adds some compatibility code for levels and tapes created later that require the previous behaviour. This bugfix was needed for level set "rnd_sam_bateman", level 029, for example, while the compatibility code was needed for level set "rnd_gerhard_haeusler", level 023, for example. --- diff --git a/src/game.c b/src/game.c index 5c1a641a..e22a7367 100644 --- a/src/game.c +++ b/src/game.c @@ -2844,6 +2844,36 @@ static void InitGameEngine(void) // set flags for bugs and changes according to active game engine version // -------------------------------------------------------------------------- + /* + Summary of bugfix: + Fixed property "can fall" for run-time element "EL_AMOEBA_DROPPING" + + Bug was introduced in version: + 2.0.1 + + Bug was fixed in version: + 4.1.4.2 + + Description: + In version 2.0.1, a new run-time element "EL_AMOEBA_DROPPING" was added, + but the property "can fall" was missing, which caused some levels to be + unsolvable. This was fixed in version 4.1.4.2. + + Affected levels/tapes: + An example for a tape that was fixed by this bugfix is tape 029 from the + level set "rnd_sam_bateman". + The wrong behaviour will still be used for all levels or tapes that were + created/recorded with it. An example for this is tape 023 from the level + set "rnd_gerhard_haeusler", which was recorded with a buggy game engine. + */ + + boolean use_amoeba_dropping_cannot_fall_bug = + ((game.engine_version >= VERSION_IDENT(2,0,1,0) && + game.engine_version <= VERSION_IDENT(4,1,4,1)) || + (tape.playing && + tape.game_version >= VERSION_IDENT(2,0,1,0) && + tape.game_version <= VERSION_IDENT(4,1,4,1))); + /* Summary of bugfix/change: Fixed move speed of elements entering or leaving magic wall. @@ -2959,6 +2989,12 @@ static void InitGameEngine(void) // dynamically adjust element properties according to game engine version InitElementPropertiesEngine(game.engine_version); + // ---------- initialize special element properties ------------------------- + + // "EL_AMOEBA_DROPPING" missed property "can fall" between 2.0.1 and 4.1.4.1 + if (use_amoeba_dropping_cannot_fall_bug) + SET_PROPERTY(EL_AMOEBA_DROPPING, EP_CAN_FALL, FALSE); + #if 0 printf("level %d: level version == %06d\n", level_nr, level.game_version); printf(" tape version == %06d [%s] [file: %06d]\n", diff --git a/src/init.c b/src/init.c index 272cc8b9..dca18c4f 100644 --- a/src/init.c +++ b/src/init.c @@ -2862,6 +2862,7 @@ void InitElementPropertiesStatic(void) EL_BOMB, EL_NUT, EL_AMOEBA_DROP, + EL_AMOEBA_DROPPING, EL_QUICKSAND_FULL, EL_QUICKSAND_FAST_FULL, EL_MAGIC_WALL_FULL,