From 984352dd00af1b4f9087bb60062515a03fea642a Mon Sep 17 00:00:00 2001 From: trml Date: Sun, 8 Nov 2020 14:05:44 +0100 Subject: [PATCH] Only use individual character flags for collision when ddnetchar is available --- src/game/client/gameclient.cpp | 7 +++++++ src/game/gamecore.cpp | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 7f05d7eda..9917b2c18 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -2217,6 +2217,13 @@ void CGameClient::UpdatePrediction() else m_GameWorld.TuningList()[TuneZone] = m_GameWorld.m_Core.m_Tuning[g_Config.m_ClDummy] = m_Tuning[g_Config.m_ClDummy]; + // if ddnetcharacter is available, ignore server-wide tunings for hook and collision + if(m_Snap.m_aCharacters[m_Snap.m_LocalClientID].m_HasExtendedData) + { + m_GameWorld.m_Tuning[g_Config.m_ClDummy].m_PlayerCollision = 1; + m_GameWorld.m_Tuning[g_Config.m_ClDummy].m_PlayerHooking = 1; + } + // restore characters from previously saved ones if they temporarily left the snapshot for(int i = 0; i < MAX_CLIENTS; i++) if(m_aLastWorldCharacters[i].IsAlive() && m_Snap.m_aCharacters[i].m_Active && !m_GameWorld.GetCharacterByID(i)) diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index 2472c18f1..aa7b4a2f2 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -559,6 +559,9 @@ void CCharacterCore::ReadDDNet(const CNetObj_DDNetCharacter *pObjDDNet) m_NoHookHit = pObjDDNet->m_Flags & CHARACTERFLAG_NO_HOOK; m_Super = pObjDDNet->m_Flags & CHARACTERFLAG_SUPER; + m_Hook = !m_NoHookHit; + m_Collision = !m_NoCollision; + // Endless m_EndlessHook = pObjDDNet->m_Flags & CHARACTERFLAG_ENDLESS_HOOK; m_EndlessJump = pObjDDNet->m_Flags & CHARACTERFLAG_ENDLESS_JUMP;