From 7aa4652715e425f618537fa9ede637ba61a3bb1d Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Sat, 11 Sep 2021 00:14:02 +0200 Subject: [PATCH] Always send correct zoom dimensions --- src/game/client/components/camera.h | 2 +- src/game/client/gameclient.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/camera.h b/src/game/client/components/camera.h index 7ef3c6785..6631ab49a 100644 --- a/src/game/client/components/camera.h +++ b/src/game/client/components/camera.h @@ -21,7 +21,6 @@ class CCamera : public CComponent vec2 m_LastPos[NUM_DUMMIES]; vec2 m_PrevCenter; - bool m_Zooming; CCubicBezier m_ZoomSmoothing; float m_ZoomSmoothingStart; float m_ZoomSmoothingEnd; @@ -36,6 +35,7 @@ class CCamera : public CComponent public: vec2 m_Center; bool m_ZoomSet; + bool m_Zooming; float m_Zoom; float m_ZoomSmoothingTarget; diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index d3f56f491..0f5b1e928 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -1596,7 +1596,7 @@ void CGameClient::OnNewSnapshot() } float ZoomToSend = m_Camera.m_Zoom; - if(m_Camera.m_ZoomSmoothingTarget != .0) + if(m_Camera.m_Zooming) { if(m_Camera.m_ZoomSmoothingTarget > m_Camera.m_Zoom) // Zooming out ZoomToSend = m_Camera.m_ZoomSmoothingTarget;