Fix NaNs created by bad initialization

This commit is contained in:
Jupeyy 2020-10-17 18:17:13 +02:00
parent 331249ed89
commit 6426e341f3
3 changed files with 16 additions and 0 deletions

View file

@ -1023,6 +1023,12 @@ CCharacter::CCharacter(CGameWorld *pGameWorld, int ID, CNetObj_Character *pChar,
m_TeleCheckpoint = 0;
m_StrongWeakID = 0;
// never intilize both to zero
m_Input.m_TargetX = 0;
m_Input.m_TargetY = -1;
m_LatestPrevInput = m_LatestInput = m_PrevInput = m_SavedInput = m_Input;
ResetPrediction();
Read(pChar, pExtended, false);

View file

@ -112,6 +112,10 @@ void CCharacterCore::Reset()
m_HasTelegunLaser = false;
m_FreezeEnd = 0;
m_DeepFrozen = false;
// never initialize both to 0
m_Input.m_TargetX = 0;
m_Input.m_TargetY = -1;
}
void CCharacterCore::Tick(bool UseInput)

View file

@ -24,6 +24,12 @@ CCharacter::CCharacter(CGameWorld *pWorld) :
m_Health = 0;
m_Armor = 0;
m_StrongWeakID = 0;
// never intilize both to zero
m_Input.m_TargetX = 0;
m_Input.m_TargetY = -1;
m_LatestPrevPrevInput = m_LatestPrevInput = m_LatestInput = m_PrevInput = m_SavedInput = m_Input;
}
void CCharacter::Reset()