diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index cc3c3f3a6..200f3eef9 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -210,10 +210,12 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) UI()->DoLabelScaled(&Label, aBuf, 14.0, -1); static float s_OffsetName = 0.0f; if(DoEditBox(Name, &Button, Name, sizeof(g_Config.m_PlayerName), 14.0f, &s_OffsetName)) + { if(s_Dummy) m_NeedSendDummyinfo = true; else m_NeedSendinfo = true; + } if(DoButton_CheckBox(&g_Config.m_ClShowKillMessages, Localize("Dummy Settings"), s_Dummy, &Dummy)) { @@ -229,10 +231,12 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) UI()->DoLabelScaled(&Label, aBuf, 14.0, -1); static float s_OffsetClan = 0.0f; if(DoEditBox(Clan, &Button, Clan, sizeof(g_Config.m_PlayerClan), 14.0f, &s_OffsetClan)) + { if(s_Dummy) m_NeedSendDummyinfo = true; else m_NeedSendinfo = true; + } // country flag selector MainView.HSplitTop(20.0f, 0, &MainView); diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 709a6379b..07eac4eb4 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -243,6 +243,8 @@ void CGameClient::OnConsoleInit() Console()->Chain("dummy_color_feet", ConchainSpecialDummyInfoupdate, this); Console()->Chain("dummy_skin", ConchainSpecialDummyInfoupdate, this); + Console()->Chain("cl_dummy", ConchainSpecialDummy, this); + // m_SuppressEvents = false; } @@ -555,6 +557,9 @@ void CGameClient::OnRender() m_NewTick = false; m_NewPredictedTick = false; + if(g_Config.m_ClDummy && !Client()->DummyConnected()) + g_Config.m_ClDummy = 0; + // check if client info has to be resent if(m_LastSendInfo && Client()->State() == IClient::STATE_ONLINE && m_Snap.m_LocalClientID >= 0 && !m_pMenus->IsActive() && m_LastSendInfo+time_freq()*6 < time_get()) { @@ -1406,6 +1411,14 @@ void CGameClient::ConchainSpecialDummyInfoupdate(IConsole::IResult *pResult, voi ((CGameClient*)pUserData)->SendDummyInfo(false); } +void CGameClient::ConchainSpecialDummy(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) +{ + pfnCallback(pResult, pCallbackUserData); + if(pResult->NumArguments()) + if(g_Config.m_ClDummy && !((CGameClient*)pUserData)->Client()->DummyConnected()) + g_Config.m_ClDummy = 0; +} + IGameClient *CreateGameClient() { return &g_GameClient; diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index df9979e14..cfa802e61 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -68,6 +68,7 @@ class CGameClient : public IGameClient static void ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); static void ConchainSpecialDummyInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); + static void ConchainSpecialDummy(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); public: IKernel *Kernel() { return IInterface::Kernel(); }