From: Holger Schemel Date: Sun, 9 Jun 2002 22:52:58 +0000 (+0200) Subject: rnd-20020610-1-src X-Git-Tag: 2.1.0^2~6 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=dd8c2278ba26f777d147a011a4e23ebaab8091cd;p=rocksndiamonds.git rnd-20020610-1-src --- diff --git a/src/files.c b/src/files.c index e4b5a731..76fd384a 100644 --- a/src/files.c +++ b/src/files.c @@ -690,8 +690,6 @@ static void setTapeInfoToDefaults() int i; /* always start with reliable default values (empty tape) */ - tape.file_version = FILE_VERSION_ACTUAL; - tape.game_version = GAME_VERSION_ACTUAL; TapeErase(); /* default values (also for pre-1.2 tapes) with only the first player */ @@ -731,8 +729,7 @@ static int LoadTape_HEAD(FILE *file, int chunk_size, struct TapeInfo *tape) if (tape->file_version >= FILE_VERSION_1_2) { byte store_participating_players = fgetc(file); - - ReadUnusedBytesFromFile(file, TAPE_HEADER_UNUSED); + int engine_version; /* since version 1.2, tapes store which players participate in the tape */ tape->num_participating_players = 0; @@ -747,7 +744,11 @@ static int LoadTape_HEAD(FILE *file, int chunk_size, struct TapeInfo *tape) } } - ReadUnusedBytesFromFile(file, 4); + ReadUnusedBytesFromFile(file, TAPE_HEADER_UNUSED); + + engine_version = getFileVersion(file); + if (engine_version > 0) + tape->engine_version = engine_version; } return chunk_size; @@ -977,9 +978,10 @@ static void SaveTape_HEAD(FILE *file, struct TapeInfo *tape) fputc(store_participating_players, file); + /* unused bytes not at the end here for 4-byte alignment of engine_version */ WriteUnusedBytesToFile(file, TAPE_HEADER_UNUSED); - WriteUnusedBytesToFile(file, 4); + putFileVersion(file, tape->engine_version); } static void SaveTape_BODY(FILE *file, struct TapeInfo *tape) diff --git a/src/game.c b/src/game.c index f844675e..a6f6ce26 100644 --- a/src/game.c +++ b/src/game.c @@ -599,29 +599,10 @@ void InitGameSound() static void InitGameEngine() { - boolean emulate_bd = TRUE; /* unless non-BOULDERDASH elements found */ - boolean emulate_sb = TRUE; /* unless non-SOKOBAN elements found */ - boolean emulate_sp = TRUE; /* unless non-SUPAPLEX elements found */ - int i, x, y; - - for(y=0; ymove_delay, player->move_delay_value) && - !(tape.playing && tape.game_version < GAME_VERSION_2_0)) + !(tape.playing && tape.file_version < FILE_VERSION_2_0)) return FALSE; #endif @@ -6063,7 +6062,7 @@ int DigField(struct PlayerInfo *player, return MF_NO_ACTION; #else if (!FrameReached(&player->push_delay, player->push_delay_value) && - !(tape.playing && tape.game_version < GAME_VERSION_2_0) && + !(tape.playing && tape.file_version < FILE_VERSION_2_0) && element != EL_SPRING) return MF_NO_ACTION; #endif @@ -6305,7 +6304,7 @@ int DigField(struct PlayerInfo *player, return MF_NO_ACTION; #else if (!FrameReached(&player->push_delay, player->push_delay_value) && - !(tape.playing && tape.game_version < GAME_VERSION_2_0) && + !(tape.playing && tape.file_version < FILE_VERSION_2_0) && element != EL_BALLOON) return MF_NO_ACTION; #endif diff --git a/src/timestamp.h b/src/timestamp.h index 7d84c543..e1c332bf 100644 --- a/src/timestamp.h +++ b/src/timestamp.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-06-09 22:29]" +#define COMPILE_DATE_STRING "[2002-06-10 00:51]"