From: Holger Schemel Date: Sun, 4 Jun 2006 00:05:45 +0000 (+0200) Subject: rnd-20060604-1-src X-Git-Tag: 3.2.0^2~8 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=24cc4564457e645addf08604dc80fbab152c8590 rnd-20060604-1-src * fixed bug with player exploding when moving into acid * fixed bug with level settings being reset in editor and when playing (some compatibility settings being set not only after level loading) --- diff --git a/ChangeLog b/ChangeLog index 4594e02d..fbbf09c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-06-03 + * fixed bug with player exploding when moving into acid + * fixed bug with level settings being reset in editor and when playing + (some compatibility settings being set not only after level loading) * fixed crash bug when number of custom graphic frames was set to zero + * fixed bug with teleporting player on walkable tile not working anymore + * added partial compatibility support for pre-release-only "CONF" chunk + (to make Alan Bond's "color cycle" demo work again :-) ) 2006-05-30 * fixed some bugs when displaying title screens from info screen menu diff --git a/src/conftime.h b/src/conftime.h index 91a94f88..183e04a9 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-06-03 20:34]" +#define COMPILE_DATE_STRING "[2006-06-04 01:42]" diff --git a/src/files.c b/src/files.c index 5f5b1fbb..0395afae 100644 --- a/src/files.c +++ b/src/files.c @@ -1139,6 +1139,61 @@ static struct LevelFileConfigInfo chunk_config_GRPX[] = }, }; +static struct LevelFileConfigInfo chunk_config_CONF[] = /* (OBSOLETE) */ +{ + { + EL_PLAYER_1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(9), + &li.block_snap_field, TRUE + }, + { + EL_PLAYER_1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(13), + &li.continuous_snapping, TRUE + }, + { + EL_PLAYER_1, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(1), + &li.initial_player_stepsize[0], STEPSIZE_NORMAL + }, + { + EL_PLAYER_1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(10), + &li.use_start_element[0], FALSE + }, + { + EL_PLAYER_1, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(1), + &li.start_element[0], EL_PLAYER_1 + }, + { + EL_PLAYER_1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(11), + &li.use_artwork_element[0], FALSE + }, + { + EL_PLAYER_1, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(2), + &li.artwork_element[0], EL_PLAYER_1 + }, + { + EL_PLAYER_1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(12), + &li.use_explosion_element[0], FALSE + }, + { + EL_PLAYER_1, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(3), + &li.explosion_element[0], EL_PLAYER_1 + }, + + { + -1, -1, + -1, -1, + NULL, -1, + }, +}; + static struct { int filetype; @@ -3010,6 +3065,28 @@ static int LoadLevel_INFO(FILE *file, int chunk_size, struct LevelInfo *level) return real_chunk_size; } +static int LoadLevel_CONF(FILE *file, int chunk_size, struct LevelInfo *level) +{ + int real_chunk_size = 0; + + li = *level; /* copy level data into temporary buffer */ + + while (!feof(file)) + { + int element = getMappedElement(getFile16BitBE(file)); + + real_chunk_size += 2; + real_chunk_size += LoadLevel_MicroChunk(file, chunk_config_CONF, + element, element); + if (real_chunk_size >= chunk_size) + break; + } + + *level = li; /* copy temporary buffer back to level data */ + + return real_chunk_size; +} + static int LoadLevel_ELEM(FILE *file, int chunk_size, struct LevelInfo *level) { int real_chunk_size = 0; @@ -3358,6 +3435,7 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level, { "CUS3", -1, LoadLevel_CUS3 }, { "CUS4", -1, LoadLevel_CUS4 }, { "GRP1", -1, LoadLevel_GRP1 }, + { "CONF", -1, LoadLevel_CONF }, { "ELEM", -1, LoadLevel_ELEM }, { "NOTE", -1, LoadLevel_NOTE }, { "CUSX", -1, LoadLevel_CUSX }, diff --git a/src/game.c b/src/game.c index ed436b4a..7cf63d08 100644 --- a/src/game.c +++ b/src/game.c @@ -8450,8 +8450,10 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change) #if USE_NEW_CUSTOM_VALUE int last_ce_value = CustomValue[x][y]; #endif - boolean add_player = (ELEM_IS_PLAYER(new_element) && - IS_WALKABLE(old_element)); + boolean new_element_is_player = ELEM_IS_PLAYER(new_element); + boolean add_player_onto_element = (new_element_is_player && + new_element != EL_SOKOBAN_FIELD_PLAYER && + IS_WALKABLE(old_element)); #if 0 /* check if element under the player changes from accessible to unaccessible @@ -8465,7 +8467,7 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change) } #endif - if (!add_player) + if (!add_player_onto_element) { if (IS_MOVING(x, y) || IS_BLOCKED(x, y)) RemoveMovingField(x, y); @@ -8516,7 +8518,7 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change) #endif /* "ChangeCount" not set yet to allow "entered by player" change one time */ - if (ELEM_IS_PLAYER(new_element)) + if (new_element_is_player) RelocatePlayer(x, y, new_element); if (is_change)