- fixed: DScroller did not initialize m_LastHeight in all situations. This caused a problem with the serializer because RapidJSON aborts the write of a floating point value if it is invalid.

- ensure that floats are always written out. If the actual value causes an error (i.e. INF or NaN), write a 0 to guarantee proper formatting.
This commit is contained in:
Christoph Oelckers 2016-09-28 11:58:12 +02:00
commit 2d5061e81f
2 changed files with 10 additions and 2 deletions

View file

@ -259,6 +259,7 @@ DScroller::DScroller (EScroll type, double dx, double dy,
m_Accel = accel;
m_Parts = scrollpos;
m_vdx = m_vdy = 0;
m_LastHeight = 0;
if ((m_Control = control) != -1)
m_LastHeight =
sectors[control].CenterFloor () + sectors[control].CenterCeiling ();
@ -342,6 +343,7 @@ DScroller::DScroller (double dx, double dy, const line_t *l,
m_vdx = m_vdy = 0;
m_Accel = accel;
m_Parts = scrollpos;
m_LastHeight = 0;
if ((m_Control = control) != -1)
m_LastHeight = sectors[control].CenterFloor() + sectors[control].CenterCeiling();
m_Affectee = int(l->sidedef[0] - sides);