Skip to content
Permalink
Browse files

fix #6315

  • Loading branch information...
rtri
rtri committed Oct 6, 2019
1 parent 3687956 commit 7cd82b8654468fee94d634a7e84e38bc808ec3ae
Showing with 4 additions and 2 deletions.
  1. +4 −2 rts/Game/PreGame.cpp
@@ -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());
}

0 comments on commit 7cd82b8

Please sign in to comment.
You can’t perform that action at this time.