mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed weapon change on start bug
This commit is contained in:
parent
9753f62d46
commit
d37c83962d
|
@ -30,6 +30,11 @@ void CControls::OnReset()
|
|||
m_InputDirectionRight = 0;
|
||||
}
|
||||
|
||||
void CControls::OnPlayerDeath()
|
||||
{
|
||||
m_LastData.m_WantedWeapon = m_InputData.m_WantedWeapon = 0;
|
||||
}
|
||||
|
||||
static void ConKeyInputState(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
((int *)pUserData)[0] = pResult->GetInteger(0);
|
||||
|
|
|
@ -21,6 +21,7 @@ public:
|
|||
virtual void OnMessage(int MsgType, void *pRawMsg);
|
||||
virtual bool OnMouseMove(float x, float y);
|
||||
virtual void OnConsoleInit();
|
||||
virtual void OnPlayerDeath();
|
||||
|
||||
int SnapInput(int *pData);
|
||||
};
|
||||
|
|
|
@ -764,6 +764,11 @@ void CGameClient::OnNewSnapshot()
|
|||
m_Snap.m_pLocalPrevCharacter = &c->m_Prev;
|
||||
m_LocalCharacterPos = vec2(m_Snap.m_pLocalCharacter->m_X, m_Snap.m_pLocalCharacter->m_Y);
|
||||
}
|
||||
else if(Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, m_Snap.m_LocalCid))
|
||||
{
|
||||
// player died
|
||||
m_pControls->OnPlayerDeath();
|
||||
}
|
||||
}
|
||||
else
|
||||
m_Snap.m_Spectate = true;
|
||||
|
|
Loading…
Reference in a new issue