From 7af575daec0a673350582d7efef847300631b381 Mon Sep 17 00:00:00 2001 From: Ilya Shurumov Date: Mon, 31 Aug 2020 15:14:48 +0600 Subject: [PATCH] - cutscene recorder subreplay selection --- src_rebuild/GAME/C/MAIN.C | 10 +++++----- src_rebuild/GAME/C/REPLAYS.C | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src_rebuild/GAME/C/MAIN.C b/src_rebuild/GAME/C/MAIN.C index 7dfeae68..556bd32f 100644 --- a/src_rebuild/GAME/C/MAIN.C +++ b/src_rebuild/GAME/C/MAIN.C @@ -2569,7 +2569,7 @@ int redriver2_main(int argc, char** argv) { if (argc-i < 3) { - printWarning("Example: -recordcutscene "); + printWarning("Example: -recordcutscene "); return 0; } @@ -2578,17 +2578,17 @@ int redriver2_main(int argc, char** argv) gInFrontend = 0; AttractMode = 0; - int player_id = atoi(argv[i+3]); + int subindx = atoi(argv[i+2]); extern int LoadCutsceneAsReplay(int subindex); extern int gCutsceneAsReplay; extern int gCutsceneAsReplay_PlayerId; gCutsceneAsReplay = atoi(argv[i + 1]); // acts as cutscene mission - gCurrentMissionNumber = atoi(argv[i + 2]); // acts as base mission. Some mission requires other base - gCutsceneAsReplay_PlayerId = atoi(argv[i + 3]); + gCurrentMissionNumber = atoi(argv[i + 3]); // acts as base mission. Some mission requires other base + gCutsceneAsReplay_PlayerId = 0; - if (LoadCutsceneAsReplay(0)) + if (LoadCutsceneAsReplay(subindx)) { CurrentGameMode = GAMEMODE_REPLAY; gLoadedReplay = 1; diff --git a/src_rebuild/GAME/C/REPLAYS.C b/src_rebuild/GAME/C/REPLAYS.C index 5d0e7316..66a88e53 100644 --- a/src_rebuild/GAME/C/REPLAYS.C +++ b/src_rebuild/GAME/C/REPLAYS.C @@ -190,6 +190,7 @@ int SaveReplayToBuffer(char *buffer) // write each stream data #ifdef CUTSCENE_RECORDER + extern int gCutsceneAsReplay; int numStreams = gCutsceneAsReplay ? NumReplayStreams : NumPlayers; for (int i = 0; i < numStreams; i++) @@ -340,7 +341,9 @@ int LoadCutsceneAsReplay(int subindex) LoadfileSeg(filename, _other_buffer, offset, size); - return LoadReplayFromBuffer(_other_buffer); + int result = LoadReplayFromBuffer(_other_buffer); + + return result; } }