Ignore user inputs when paused

This commit is contained in:
def 2014-09-07 01:53:20 +02:00
parent 93b57433b4
commit bb6c3ba951
2 changed files with 9 additions and 0 deletions

View file

@ -33,6 +33,7 @@ protected:
class CCollision *Collision() const { return m_pClient->Collision(); }
public:
virtual ~CComponent() {}
class CGameClient *GameClient() const { return m_pClient; }
class IClient *Client() const { return m_pClient->Client(); }
virtual void OnStateChange(int NewState, int OldState) {};

View file

@ -123,6 +123,10 @@ struct CInputState
static void ConKeyInputState(IConsole::IResult *pResult, void *pUserData)
{
CInputState *pState = (CInputState *)pUserData;
if (pState->m_pControls->GameClient()->m_Snap.m_SpecInfo.m_Active)
return;
if (g_Config.m_ClDummy)
*pState->m_pVariable2 = pResult->GetInteger(0);
else
@ -132,6 +136,10 @@ static void ConKeyInputState(IConsole::IResult *pResult, void *pUserData)
static void ConKeyInputCounter(IConsole::IResult *pResult, void *pUserData)
{
CInputState *pState = (CInputState *)pUserData;
if (pState->m_pControls->GameClient()->m_Snap.m_SpecInfo.m_Active)
return;
int *v;
if (g_Config.m_ClDummy)
v = pState->m_pVariable2;