diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 39d33f24d..867d82be8 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -464,16 +464,20 @@ void CClient::SendInput() } } + if(!g_Config.m_ClDummy) + m_LocalIDs[0] = ((CGameClient *)GameClient())->m_Snap.m_LocalClientID; + else + m_LocalIDs[1] = ((CGameClient *)GameClient())->m_Snap.m_LocalClientID; + if(m_DummyConnected) { - if(!g_Config.m_ClDummy) - m_LocalIDs[0] = ((CGameClient *)GameClient())->m_Snap.m_LocalClientID; - else - m_LocalIDs[1] = ((CGameClient *)GameClient())->m_Snap.m_LocalClientID; - if(!g_Config.m_ClDummyHammer) { - m_Fire = 25; + if(m_Fire != 25) + { + DummyInput.m_Fire = HammerInput.m_Fire; + m_Fire = 25; + } if(!Size && (!DummyInput.m_Direction && !DummyInput.m_Jump && !DummyInput.m_Hook)) return; @@ -499,27 +503,26 @@ void CClient::SendInput() } m_Fire++; - CNetObj_PlayerInput DummyData; - mem_zero(&DummyData, sizeof(DummyData)); + mem_zero(&HammerInput, sizeof(HammerInput)); - DummyData.m_Fire = (int) ((float) m_Fire / 12.5); - DummyData.m_WantedWeapon = 1; + HammerInput.m_Fire = (int) ((float) m_Fire / 12.5); + HammerInput.m_WantedWeapon = 1; CNetObj_Character Main = ((CGameClient *)GameClient())->m_Snap.m_aCharacters[m_LocalIDs[g_Config.m_ClDummy]].m_Cur; CNetObj_Character Dummy = ((CGameClient *)GameClient())->m_Snap.m_aCharacters[m_LocalIDs[!g_Config.m_ClDummy]].m_Cur; vec2 Dir = vec2(Main.m_X - Dummy.m_X, Main.m_Y - Dummy.m_Y); - DummyData.m_TargetX = Dir.x; - DummyData.m_TargetY = Dir.y; + HammerInput.m_TargetX = Dir.x; + HammerInput.m_TargetY = Dir.y; // pack input CMsgPacker Msg(NETMSG_INPUT); Msg.AddInt(m_AckGameTick[g_Config.m_ClDummy]); Msg.AddInt(m_PredTick[g_Config.m_ClDummy]); - Msg.AddInt(sizeof(DummyData)); + Msg.AddInt(sizeof(HammerInput)); // pack it - for(unsigned int i = 0; i < sizeof(DummyData)/4; i++) - Msg.AddInt(((int*) &DummyData)[i]); + for(unsigned int i = 0; i < sizeof(HammerInput)/4; i++) + Msg.AddInt(((int*) &HammerInput)[i]); SendMsgExY(&Msg, MSGFLAG_FLUSH, true, !g_Config.m_ClDummy); } diff --git a/src/engine/client/client.h b/src/engine/client/client.h index 99dcc9741..19772a7e3 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -147,6 +147,7 @@ class CClient : public IClient, public CDemoPlayer::IListner int m_CurrentInput; bool m_LastDummy; CNetObj_PlayerInput DummyInput; + CNetObj_PlayerInput HammerInput; // graphs CGraph m_InputtimeMarginGraph;