From: Holger Schemel Date: Mon, 23 Nov 1998 01:02:45 +0000 (+0100) Subject: rnd-19981123-3 X-Git-Tag: 1.2.0^2~13 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7600b7d74df219d2a0956e03cea3af49226903c2;p=rocksndiamonds.git rnd-19981123-3 --- diff --git a/src/files.c b/src/files.c index 80a5e7cb..81838cf4 100644 --- a/src/files.c +++ b/src/files.c @@ -403,7 +403,6 @@ void LoadTape(int level_nr) char cookie[MAX_LINE_LEN]; char chunk[CHUNK_ID_LEN + 1]; FILE *file; - boolean player_participates[MAX_PLAYERS]; int num_participating_players; int file_version = FILE_VERSION_1_2; /* last version of tape files */ int chunk_length; @@ -464,11 +463,11 @@ void LoadTape(int level_nr) num_participating_players = 0; for(i=0; i 0) continue; - if (player_participates[j]) + if (tape.player_participates[j]) tape.pos[i].action[j] = fgetc(file); } @@ -559,11 +558,10 @@ void LoadTape(int level_nr) void SaveTape(int level_nr) { - int i, j; + int i; char filename[MAX_FILENAME_LEN]; FILE *file; boolean new_tape = TRUE; - boolean player_participates[MAX_PLAYERS]; byte store_participating_players; int num_participating_players; int chunk_length; @@ -584,21 +582,12 @@ void SaveTape(int level_nr) return; } - for(i=0; ijx, jy = player->jy; + + player->active = FALSE; + StorePlayer[jx][jy] = 0; + Feld[jx][jy] = EL_LEERRAUM; + } + } + } + else if (!options.network && !setup.team_mode) /* && !tape.playing */ { + /* when in single player mode, eliminate all but the first active player */ + for (i=0; ijx, jy = player->jy; - - if (player->active) + if (stored_player[j].active) { + struct PlayerInfo *player = &stored_player[j]; + int jx = player->jx, jy = player->jy; + player->active = FALSE; StorePlayer[jx][jy] = 0; Feld[jx][jy] = EL_LEERRAUM; @@ -450,6 +468,14 @@ void InitGame() } } + /* when recording the game, store which players take part in the game */ + if (tape.recording) + { + for (i=0; itm_year%100) + 100*zeit2->tm_mon + zeit2->tm_mday; tape.random_seed = InitRND(NEW_RANDOMIZE); + for(i=0; i