Skip to content

Commit

Permalink
fix demo length crash, fix hookline losing precision with higher tick…
Browse files Browse the repository at this point in the history
…rates
  • Loading branch information
JSaurusRex committed Dec 7, 2023
1 parent d7ca9ae commit ea0385a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/engine/shared/demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/game/client/components/players.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit ea0385a

Please sign in to comment.