From: Holger Schemel Date: Wed, 10 Oct 2018 21:04:49 +0000 (+0200) Subject: added flag to level files for using "game of life" bugs X-Git-Tag: 4.1.2.0~143 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=f655d278060b2c79fc64a82bbd727a25136fd6a5;p=rocksndiamonds.git added flag to level files for using "game of life" bugs --- diff --git a/src/files.c b/src/files.c index 99713e19..605efc27 100644 --- a/src/files.c +++ b/src/files.c @@ -668,6 +668,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_INTEGER, CONF_VALUE_8_BIT(4), &li.game_of_life[3], 3 }, + { + EL_GAME_OF_LIFE, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(5), + &li.use_life_bugs, FALSE + }, { EL_BIOMAZE, -1, @@ -6309,6 +6314,10 @@ static void LoadLevel_InitVersion(struct LevelInfo *level) level->extra_time_score = level->score[SC_TIME_BONUS]; } + /* game logic of "game of life" and "biomaze" was buggy before 4.1.1.1 */ + if (level->game_version < VERSION_IDENT(4,1,1,1)) + level->use_life_bugs = TRUE; + if (level->game_version < VERSION_IDENT(3,2,0,7)) { /* default behaviour for snapping was "not continuous" before 3.2.0-7 */ diff --git a/src/game.c b/src/game.c index 18d020bd..5fa57e59 100644 --- a/src/game.c +++ b/src/game.c @@ -8896,7 +8896,6 @@ static void Life(int ax, int ay) int *life_parameter = (element == EL_GAME_OF_LIFE ? level.game_of_life : level.biomaze); boolean changed = FALSE; - boolean use_life_bugs = FALSE; if (IS_ANIMATED(graphic)) DrawLevelGraphicAnimationIfNeeded(ax, ay, graphic); @@ -8933,7 +8932,7 @@ static void Life(int ax, int ay) boolean is_player_cell = (element == EL_GAME_OF_LIFE && IS_PLAYER(x, y)); boolean is_neighbour = FALSE; - if (use_life_bugs) + if (level.use_life_bugs) is_neighbour = (((Feld[x][y] == element || is_player_cell) && !Stop[x][y]) || (IS_FREE(x, y) && Stop[x][y])); @@ -8947,7 +8946,7 @@ static void Life(int ax, int ay) boolean is_free = FALSE; - if (use_life_bugs) + if (level.use_life_bugs) is_free = (IS_FREE(xx, yy)); else is_free = (IS_FREE(xx, yy) && Last[xx][yy] == EL_EMPTY); diff --git a/src/main.h b/src/main.h index 935d6020..77430622 100644 --- a/src/main.h +++ b/src/main.h @@ -3089,6 +3089,7 @@ struct LevelInfo boolean em_explodes_by_fire; /* EM style chain explosion behaviour */ boolean use_spring_bug; /* for compatibility with old levels */ boolean use_time_orb_bug; /* for compatibility with old levels */ + boolean use_life_bugs; /* for compatibility with old levels */ boolean instant_relocation; /* no visual delay when relocating player */ boolean shifted_relocation; /* no level centering when relocating player */ boolean lazy_relocation; /* only redraw off-screen player relocation */