From: Holger Schemel Date: Sat, 30 Aug 2014 08:43:25 +0000 (+0200) Subject: Merge branch 'master' into releases X-Git-Tag: 3.0.2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=refs%2Ftags%2F3.0.2;hp=5256734485f2dc391d80ddb70f7cdfe28fff2c75;p=rocksndiamonds.git Merge branch 'master' into releases --- diff --git a/CHANGES b/CHANGES index 59296c15..347e1d7d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Release Version 3.0.2 [22 AUG 2003] +----------------------------------- + - fixed bug with messing up custom element properties in 3.0.0 levels + - fixed bug with choosing wrong engine version when playing tapes + - fixed bug with creating inaccessible elements at player position + - fixed bug with not finding current level artwork directory + Release Version 3.0.1 [18 AUG 2003] ----------------------------------- - fixed bug that caused a crash at startup under Solaris diff --git a/src/conftime.h b/src/conftime.h index 052f4be3..6d2a47a8 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-08-18 21:51]" +#define COMPILE_DATE_STRING "[2003-08-21 23:55]" diff --git a/src/files.c b/src/files.c index 358333a4..e17ef526 100644 --- a/src/files.c +++ b/src/files.c @@ -682,16 +682,17 @@ void LoadLevelFromFilename(struct LevelInfo *level, char *filename) static void LoadLevel_InitLevel(struct LevelInfo *level, char *filename) { - int x, y; + int i, j, x, y; if (leveldir_current == NULL) /* only when dumping level */ return; + /* determine correct game engine version of current level */ if (IS_LEVELCLASS_CONTRIBUTION(leveldir_current) || IS_LEVELCLASS_USER(leveldir_current)) { #if 0 - printf("::: This level is private or contributed: '%s'\n", filename); + printf("\n::: This level is private or contributed: '%s'\n", filename); #endif /* For user contributed and private levels, use the version of @@ -719,7 +720,7 @@ static void LoadLevel_InitLevel(struct LevelInfo *level, char *filename) else { #if 0 - printf("::: ALWAYS USE LATEST ENGINE FOR THIS LEVEL: [%d] '%s'\n", + printf("\n::: ALWAYS USE LATEST ENGINE FOR THIS LEVEL: [%d] '%s'\n", leveldir_current->sort_priority, filename); #endif @@ -743,7 +744,7 @@ static void LoadLevel_InitLevel(struct LevelInfo *level, char *filename) level->em_slippery_gems = TRUE; } - /* map elements which have changed in newer versions */ + /* map elements that have changed in newer versions */ for(y=0; yfieldy; y++) { for(x=0; xfieldx; x++) @@ -773,6 +774,36 @@ static void LoadLevel_InitLevel(struct LevelInfo *level, char *filename) } } + /* map custom element change events that have changed in newer versions + (these following values have accidentally changed in version 3.0.1) */ + if (level->game_version <= VERSION_IDENT(3,0,0)) + { + for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + + /* order of checking events to be mapped is important */ + for (j=CE_BY_OTHER; j >= CE_BY_PLAYER; j--) + { + if (HAS_CHANGE_EVENT(element, j - 2)) + { + SET_CHANGE_EVENT(element, j - 2, FALSE); + SET_CHANGE_EVENT(element, j, TRUE); + } + } + + /* order of checking events to be mapped is important */ + for (j=CE_OTHER_GETS_COLLECTED; j >= CE_COLLISION; j--) + { + if (HAS_CHANGE_EVENT(element, j - 1)) + { + SET_CHANGE_EVENT(element, j - 1, FALSE); + SET_CHANGE_EVENT(element, j, TRUE); + } + } + } + } + /* copy elements to runtime playfield array */ for(x=0; x 0) tape->engine_version = engine_version; + else + tape->engine_version = tape->game_version; } return chunk_size; @@ -1506,7 +1539,8 @@ void LoadTapeFromFilename(char *filename) tape.length_seconds = GetTapeLength(); #if 0 - printf("tape version: %d\n", tape.game_version); + printf("tape game version: %d\n", tape.game_version); + printf("tape engine version: %d\n", tape.engine_version); #endif } diff --git a/src/game.c b/src/game.c index 1aef43ab..74c934d2 100644 --- a/src/game.c +++ b/src/game.c @@ -5310,13 +5310,14 @@ static void ChangeActiveTrap(int x, int y) static void ChangeElementNowExt(int x, int y, int target_element) { -#if 0 /* !!! let the player exacpe from a suddenly unaccessible element */ - if (IS_PLAYER(x, y) && !IS_ACCESSIBLE(target_element)) + /* check if element under player changes from accessible to unaccessible + (needed for special case of dropping element which then changes) */ + if (IS_PLAYER(x, y) && + IS_ACCESSIBLE(Feld[x][y]) && !IS_ACCESSIBLE(target_element)) { Bang(x, y); return; } -#endif RemoveField(x, y); Feld[x][y] = target_element; @@ -6341,6 +6342,10 @@ boolean MoveFigureOneStep(struct PlayerInfo *player, if (can_move != MF_MOVING) return can_move; + /* check if DigField() has caused relocation of the player */ + if (player->jx != jx || player->jy != jy) + return MF_NO_ACTION; + StorePlayer[jx][jy] = 0; player->last_jx = jx; player->last_jy = jy; diff --git a/src/init.c b/src/init.c index 2403d415..c129a676 100644 --- a/src/init.c +++ b/src/init.c @@ -3241,7 +3241,7 @@ void InitLevelArtworkInfo() static void InitImages() { -#if 0 +#if 1 setLevelArtworkDir(artwork.gfx_first); #endif @@ -3267,7 +3267,7 @@ static void InitSound(char *identifier) if (identifier == NULL) identifier = artwork.snd_current->identifier; -#if 0 +#if 1 /* set artwork path to send it to the sound server process */ setLevelArtworkDir(artwork.snd_first); #endif @@ -3281,7 +3281,7 @@ static void InitMusic(char *identifier) if (identifier == NULL) identifier = artwork.mus_current->identifier; -#if 0 +#if 1 /* set artwork path to send it to the sound server process */ setLevelArtworkDir(artwork.mus_first); #endif diff --git a/src/main.h b/src/main.h index 7f085896..5a9ef388 100644 --- a/src/main.h +++ b/src/main.h @@ -156,7 +156,7 @@ (PROPERTY_VAR(e,p) &= ~PROPERTY_BIT(p))) -/* values for change events for custom elements */ +/* values for change events for custom elements (stored in level file) */ #define CE_DELAY 0 #define CE_TOUCHED_BY_PLAYER 1 #define CE_PRESSED_BY_PLAYER 2 @@ -174,7 +174,7 @@ #define CE_OTHER_GETS_COLLECTED 14 #define CE_OTHER_GETS_DROPPED 15 -/* values for internal purpose only (level editor) */ +/* values for activating change events (also stored in level file!) */ #define CE_BY_PLAYER 16 #define CE_BY_COLLISION 17 #define CE_BY_OTHER 18 @@ -980,9 +980,9 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 0 -#define PROGRAM_VERSION_PATCH 1 +#define PROGRAM_VERSION_PATCH 2 #define PROGRAM_VERSION_RELEASE 0 -#define PROGRAM_VERSION_STRING "3.0.1" +#define PROGRAM_VERSION_STRING "3.0.2" #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel"