Only use individual character flags for collision when ddnetchar is available

This commit is contained in:
trml 2020-11-08 14:05:44 +01:00
parent 03fbb9f423
commit 984352dd00
2 changed files with 10 additions and 0 deletions

View file

@ -2217,6 +2217,13 @@ void CGameClient::UpdatePrediction()
else else
m_GameWorld.TuningList()[TuneZone] = m_GameWorld.m_Core.m_Tuning[g_Config.m_ClDummy] = m_Tuning[g_Config.m_ClDummy]; 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 // restore characters from previously saved ones if they temporarily left the snapshot
for(int i = 0; i < MAX_CLIENTS; i++) for(int i = 0; i < MAX_CLIENTS; i++)
if(m_aLastWorldCharacters[i].IsAlive() && m_Snap.m_aCharacters[i].m_Active && !m_GameWorld.GetCharacterByID(i)) if(m_aLastWorldCharacters[i].IsAlive() && m_Snap.m_aCharacters[i].m_Active && !m_GameWorld.GetCharacterByID(i))

View file

@ -559,6 +559,9 @@ void CCharacterCore::ReadDDNet(const CNetObj_DDNetCharacter *pObjDDNet)
m_NoHookHit = pObjDDNet->m_Flags & CHARACTERFLAG_NO_HOOK; m_NoHookHit = pObjDDNet->m_Flags & CHARACTERFLAG_NO_HOOK;
m_Super = pObjDDNet->m_Flags & CHARACTERFLAG_SUPER; m_Super = pObjDDNet->m_Flags & CHARACTERFLAG_SUPER;
m_Hook = !m_NoHookHit;
m_Collision = !m_NoCollision;
// Endless // Endless
m_EndlessHook = pObjDDNet->m_Flags & CHARACTERFLAG_ENDLESS_HOOK; m_EndlessHook = pObjDDNet->m_Flags & CHARACTERFLAG_ENDLESS_HOOK;
m_EndlessJump = pObjDDNet->m_Flags & CHARACTERFLAG_ENDLESS_JUMP; m_EndlessJump = pObjDDNet->m_Flags & CHARACTERFLAG_ENDLESS_JUMP;