engine: client: fix uninitialized fadeTotalEnd in screenfade parsing code

This commit is contained in:
Alibek Omarov 2023-01-16 09:21:30 +03:00
parent 9c0c1a802c
commit 5313dc9475

View File

@ -1835,7 +1835,7 @@ void CL_ParseScreenFade( sizebuf_t *msg )
duration = (float)MSG_ReadWord( msg );
holdTime = (float)MSG_ReadWord( msg );
sf->fadeFlags = MSG_ReadShort( msg );
flScale = ( sf->fadeFlags & FFADE_LONGFADE ) ? (1.0f / 256.0f) : (1.0f / 4096.0f);
flScale = FBitSet( sf->fadeFlags, FFADE_LONGFADE ) ? (1.0f / 256.0f) : (1.0f / 4096.0f);
sf->fader = MSG_ReadByte( msg );
sf->fadeg = MSG_ReadByte( msg );
@ -1848,7 +1848,7 @@ void CL_ParseScreenFade( sizebuf_t *msg )
// calc fade speed
if( duration > 0 )
{
if( sf->fadeFlags & FFADE_OUT )
if( FBitSet( sf->fadeFlags, FFADE_OUT ))
{
if( sf->fadeEnd )
{
@ -1856,6 +1856,7 @@ void CL_ParseScreenFade( sizebuf_t *msg )
}
sf->fadeEnd += cl.time;
sf->fadeTotalEnd = sf->fadeEnd;
sf->fadeReset += sf->fadeEnd;
}
else