mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
commit
02107fd2c9
|
@ -685,10 +685,11 @@ void CCharacter::SetEmote(int Emote, int Tick)
|
|||
void CCharacter::OnPredictedInput(CNetObj_PlayerInput *pNewInput)
|
||||
{
|
||||
// check for changes
|
||||
if(mem_comp(&m_Input, pNewInput, sizeof(CNetObj_PlayerInput)) != 0)
|
||||
if(mem_comp(&m_SavedInput, pNewInput, sizeof(CNetObj_PlayerInput)) != 0)
|
||||
m_LastAction = Server()->Tick();
|
||||
|
||||
// copy new input
|
||||
mem_copy(&m_SavedInput, pNewInput, sizeof(m_SavedInput));
|
||||
mem_copy(&m_Input, pNewInput, sizeof(m_Input));
|
||||
m_NumInputs++;
|
||||
|
||||
|
@ -1994,6 +1995,7 @@ void CCharacter::SendZoneMsgs()
|
|||
|
||||
void CCharacter::DDRaceTick()
|
||||
{
|
||||
mem_copy(&m_Input, &m_SavedInput, sizeof(m_Input));
|
||||
m_Armor=(m_FreezeTime >= 0)?10-(m_FreezeTime/15):0;
|
||||
if(m_Input.m_Direction != 0 || m_Input.m_Jump != 0)
|
||||
m_LastMove = Server()->Tick();
|
||||
|
|
|
@ -130,6 +130,7 @@ private:
|
|||
// input
|
||||
CNetObj_PlayerInput m_PrevInput;
|
||||
CNetObj_PlayerInput m_Input;
|
||||
CNetObj_PlayerInput m_SavedInput;
|
||||
int m_NumInputs;
|
||||
int m_Jumped;
|
||||
|
||||
|
|
Loading…
Reference in a new issue