mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 12:08:20 +00:00
better get dummyinput directly from CControls
This commit is contained in:
parent
50c80a1cfb
commit
f0d10ac62d
|
@ -210,6 +210,7 @@ public:
|
||||||
virtual int OnSnapInput(int *pData) = 0;
|
virtual int OnSnapInput(int *pData) = 0;
|
||||||
virtual void SendDummyInfo(bool Start) = 0;
|
virtual void SendDummyInfo(bool Start) = 0;
|
||||||
virtual void ResetDummyInput() = 0;
|
virtual void ResetDummyInput() = 0;
|
||||||
|
virtual const CNetObj_PlayerInput &getPlayerInput(int dummy) = 0;
|
||||||
|
|
||||||
virtual const char *GetItemName(int Type) = 0;
|
virtual const char *GetItemName(int Type) = 0;
|
||||||
virtual const char *Version() = 0;
|
virtual const char *Version() = 0;
|
||||||
|
|
|
@ -510,7 +510,7 @@ void CClient::SendInput()
|
||||||
|
|
||||||
if(m_LastDummy != (bool)g_Config.m_ClDummy)
|
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;
|
m_LastDummy = g_Config.m_ClDummy;
|
||||||
|
|
||||||
if (g_Config.m_ClDummyResetOnSwitch)
|
if (g_Config.m_ClDummyResetOnSwitch)
|
||||||
|
|
|
@ -110,6 +110,11 @@ const char *CGameClient::Version() { return GAME_VERSION; }
|
||||||
const char *CGameClient::NetVersion() { return GAME_NETVERSION; }
|
const char *CGameClient::NetVersion() { return GAME_NETVERSION; }
|
||||||
const char *CGameClient::GetItemName(int Type) { return m_NetObjHandler.GetObjName(Type); }
|
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()
|
void CGameClient::ResetDummyInput()
|
||||||
{
|
{
|
||||||
m_pControls->ResetInput(!g_Config.m_ClDummy);
|
m_pControls->ResetInput(!g_Config.m_ClDummy);
|
||||||
|
|
|
@ -314,6 +314,8 @@ public:
|
||||||
virtual const char *Version();
|
virtual const char *Version();
|
||||||
virtual const char *NetVersion();
|
virtual const char *NetVersion();
|
||||||
|
|
||||||
|
virtual const CNetObj_PlayerInput &getPlayerInput(int dummy);
|
||||||
|
|
||||||
|
|
||||||
// actions
|
// actions
|
||||||
// TODO: move these
|
// TODO: move these
|
||||||
|
|
Loading…
Reference in a new issue