mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #4149
4149: Always send correct zoom dimensions r=heinrich5991 a=fokkonaut It is required to reset the Target after it being used, in order to not trigger [this code](https://github.com/ddnet/ddnet/blob/master/src/game/client/gameclient.cpp#L1599-L1605), which would always send the m_LastZoom. This fixes it and always sends the correct zooming dimensions. ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
This commit is contained in:
commit
1feea5f25c
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue