From e8fbb440b9f390f10f662c6301892d09498be0a6 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sat, 17 Aug 2024 10:49:34 +0800 Subject: [PATCH] Fix cutting 0.6 demos Closed #8748 --- src/engine/client/client.cpp | 3 +-- src/engine/shared/demo.cpp | 1 + src/engine/shared/demo.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 162623267..06b399eae 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -3791,8 +3791,7 @@ const char *CClient::DemoPlayer_Play(const char *pFilename, int StorageType) return m_DemoPlayer.ErrorMessage(); } - m_Sixup = str_startswith(m_DemoPlayer.Info()->m_Header.m_aNetversion, "0.7"); - m_DemoPlayer.SetSixup(m_Sixup); + m_Sixup = m_DemoPlayer.IsSixup(); // load map const CMapInfo *pMapInfo = m_DemoPlayer.GetMapInfo(); diff --git a/src/engine/shared/demo.cpp b/src/engine/shared/demo.cpp index 4a3c67a5f..161e0d6cc 100644 --- a/src/engine/shared/demo.cpp +++ b/src/engine/shared/demo.cpp @@ -805,6 +805,7 @@ int CDemoPlayer::Load(class IStorage *pStorage, class IConsole *pConsole, const str_copy(m_aFilename, ""); return -1; } + m_Sixup = str_startswith(m_Info.m_Header.m_aNetversion, "0.7"); // save byte offset of map for later use m_MapOffset = io_tell(m_File); diff --git a/src/engine/shared/demo.h b/src/engine/shared/demo.h index 32777b424..0230e6023 100644 --- a/src/engine/shared/demo.h +++ b/src/engine/shared/demo.h @@ -178,7 +178,6 @@ public: int Update(bool RealTime = true); bool IsSixup() const { return m_Sixup; } - void SetSixup(bool Sixup) { m_Sixup = Sixup; } const CPlaybackInfo *Info() const { return &m_Info; } bool IsPlaying() const override { return m_File != nullptr; }