Skip to content

Commit

Permalink
fix #6315
Browse files Browse the repository at this point in the history
  • Loading branch information
rtri committed Oct 6, 2019
1 parent 3687956 commit 7cd82b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rts/Game/PreGame.cpp
Expand Up @@ -579,12 +579,14 @@ void CPreGame::GameDataReceived(std::shared_ptr<const netcode::RawPacket> packet
wantDemo = false;

if (clientNet != nullptr && wantDemo) {
assert(clientNet->GetDemoRecorder() == nullptr);

CDemoRecorder recorder = {gameSetup->mapName, gameSetup->modName, false};

recorder.WriteSetupText(gameData->GetSetupText());
recorder.SaveToDemo(packet->data, packet->length, clientNet->GetPacketTime(gs->frameNum));

assert(!clientNet->GetDemoRecorder()->IsValid());
clientNet->SetDemoRecorder(std::move(recorder));
assert(clientNet->GetDemoRecorder()->IsValid());

LOG("[PreGame::%s] recording demo to \"%s\"", __func__, (clientNet->GetDemoRecorder()->GetName()).c_str());
}
Expand Down

0 comments on commit 7cd82b8

Please sign in to comment.