better get dummyinput directly from CControls

This commit is contained in:
H-M-H 2015-11-10 20:29:12 +01:00
parent 50c80a1cfb
commit f0d10ac62d
4 changed files with 9 additions and 1 deletions

View file

@ -210,6 +210,7 @@ public:
virtual int OnSnapInput(int *pData) = 0;
virtual void SendDummyInfo(bool Start) = 0;
virtual void ResetDummyInput() = 0;
virtual const CNetObj_PlayerInput &getPlayerInput(int dummy) = 0;
virtual const char *GetItemName(int Type) = 0;
virtual const char *Version() = 0;

View file

@ -510,7 +510,7 @@ void CClient::SendInput()
if(m_LastDummy != (bool)g_Config.m_ClDummy)
{
mem_copy(&m_DummyInput, &m_aInputs[!g_Config.m_ClDummy][(m_CurrentInput[!g_Config.m_ClDummy]+200-1)%200], sizeof(m_DummyInput));
m_DummyInput = GameClient()->getPlayerInput(!g_Config.m_ClDummy);
m_LastDummy = g_Config.m_ClDummy;
if (g_Config.m_ClDummyResetOnSwitch)

View file

@ -110,6 +110,11 @@ const char *CGameClient::Version() { return GAME_VERSION; }
const char *CGameClient::NetVersion() { return GAME_NETVERSION; }
const char *CGameClient::GetItemName(int Type) { return m_NetObjHandler.GetObjName(Type); }
const CNetObj_PlayerInput &CGameClient::getPlayerInput(int dummy)
{
return m_pControls->m_InputData[dummy];
}
void CGameClient::ResetDummyInput()
{
m_pControls->ResetInput(!g_Config.m_ClDummy);

View file

@ -314,6 +314,8 @@ public:
virtual const char *Version();
virtual const char *NetVersion();
virtual const CNetObj_PlayerInput &getPlayerInput(int dummy);
// actions
// TODO: move these