From ea0385a9c4e4c72fc5df38b8992ebaf356efe603 Mon Sep 17 00:00:00 2001 From: JSaurusRex Date: Thu, 7 Dec 2023 17:17:49 +0100 Subject: [PATCH] fix demo length crash, fix hookline losing precision with higher tickrates --- src/engine/shared/demo.h | 2 +- src/game/client/components/players.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/engine/shared/demo.h b/src/engine/shared/demo.h index 2645821353d..471fede7681 100644 --- a/src/engine/shared/demo.h +++ b/src/engine/shared/demo.h @@ -55,7 +55,7 @@ class CDemoRecorder : public IDemoRecorder char *GetCurrentFilename() override { return m_aCurrentFilename; } void ClearCurrentFilename() { m_aCurrentFilename[0] = '\0'; } - int Length() const override { return (m_LastTickMarker - m_FirstTick) / m_TickRate; } + int Length() const override { return (m_LastTickMarker - m_FirstTick) / (m_TickRate ? m_TickRate : SERVER_TICK_SPEED); } }; class CDemoPlayer : public IDemoPlayer diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 0f92dc027f7..5a845f93e1c 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -198,10 +198,8 @@ void CPlayers::RenderHookCollLine( do { - CCharacterCore tmpCore; - tmpCore.m_TickSpeed = Client()->GameTickSpeed(); OldPos = NewPos; - NewPos = OldPos + ExDirection * tmpCore.ScaleValue(CCharacterCore::TUNING_SCALE_LINEAR, m_pClient->m_aTuning[g_Config.m_ClDummy].m_HookFireSpeed); + NewPos = OldPos + ExDirection * m_pClient->m_aTuning[g_Config.m_ClDummy].m_HookFireSpeed; if(distance(InitPos, NewPos) > m_pClient->m_aTuning[g_Config.m_ClDummy].m_HookLength) {