From: Holger Schemel Date: Thu, 24 Sep 2020 23:59:21 +0000 (+0200) Subject: fixed support for wrap-around levels in EM engine X-Git-Tag: 4.2.0.3~17 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0674fef44ec688158f1501b51371d53983ac96bb;p=rocksndiamonds.git fixed support for wrap-around levels in EM engine Fixed initializing wrap-around levels in the EM game engine; this was done when loading the cave, but using a run-time flag, which is not set until starting the game. This is a regression bug of commit 04c0f302. --- diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 9219e197..59c9a81e 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -277,7 +277,9 @@ void prepare_em_level(void) lev.right = lev.left + lev.width; lev.bottom = lev.top + lev.height; - if (cav.infinite) + lev.infinite = game_em.use_wrap_around; + + if (lev.infinite) { /* add linked cave buffer columns for wrap-around movement */ for (x = 0; x < lev.left; x++) diff --git a/src/game_em/emerald.h b/src/game_em/emerald.h index 629d66e3..5a4ab2e6 100644 --- a/src/game_em/emerald.h +++ b/src/game_em/emerald.h @@ -710,6 +710,7 @@ struct LOGIC /* 0 == all players at home */ boolean testmode; /* test mode */ + boolean infinite; /* flag for infinitely wide cave */ boolean killed_out_of_time; /* kill player due to time out */ int exit_x, exit_y; /* kludge for playing player exit sound */ diff --git a/src/game_em/reademc.c b/src/game_em/reademc.c index 012c3b5f..dae246c9 100644 --- a/src/game_em/reademc.c +++ b/src/game_em/reademc.c @@ -299,8 +299,6 @@ 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 = game_em.use_wrap_around; - cav.testmode = FALSE; cav.teamwork = (src[2150] & 128) != 0; /* scores */