cleaned up player flags

This commit is contained in:
oy 2012-02-15 01:40:19 +01:00
parent 23df3c609e
commit 6b8287f7c7
2 changed files with 3 additions and 5 deletions

View file

@ -1,7 +1,7 @@
from datatypes import *
Emotes = ["NORMAL", "PAIN", "HAPPY", "SURPRISE", "ANGRY", "BLINK"]
PlayerFlags = ["PLAYING", "IN_MENU", "CHATTING", "SCOREBOARD", "READY", "DEAD"]
PlayerFlags = ["CHATTING", "SCOREBOARD", "READY", "DEAD"]
GameFlags = ["TEAMS", "FLAGS", "SURVIVAL"]
GameStateFlags = ["WARMUP", "SUDDENDEATH", "ROUNDOVER", "GAMEOVER", "PAUSED", "STARTCOUNTDOWN"]

View file

@ -114,10 +114,8 @@ int CControls::SnapInput(int *pData)
// update player state
if(m_pClient->m_pChat->IsActive())
m_InputData.m_PlayerFlags = PLAYERFLAG_CHATTING;
else if(m_pClient->m_pMenus->IsActive())
m_InputData.m_PlayerFlags = PLAYERFLAG_IN_MENU;
else
m_InputData.m_PlayerFlags = PLAYERFLAG_PLAYING;
m_InputData.m_PlayerFlags = 0;
if(m_pClient->m_pScoreboard->Active())
m_InputData.m_PlayerFlags |= PLAYERFLAG_SCOREBOARD;
@ -128,7 +126,7 @@ int CControls::SnapInput(int *pData)
m_LastData.m_PlayerFlags = m_InputData.m_PlayerFlags;
// we freeze the input if chat or menu is activated
if(!(m_InputData.m_PlayerFlags&PLAYERFLAG_PLAYING))
if(m_pClient->m_pChat->IsActive() || m_pClient->m_pMenus->IsActive())
{
OnReset();