fixed weapon change on start bug

This commit is contained in:
oy 2010-08-10 13:54:13 +02:00
parent 9753f62d46
commit d37c83962d
3 changed files with 11 additions and 0 deletions

View file

@ -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);

View file

@ -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);
};

View file

@ -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;