mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix NaNs created by bad initialization
This commit is contained in:
parent
331249ed89
commit
6426e341f3
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue