mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Merge #3276
3276: Fix prediction of no hook/collision tile r=def- a=trml I believe this fixes #3043 and #2510, but I haven't tested it extensively yet (and I couldn't reproduce the bug for no-collision tiles) Perhaps there should also be some further cleanups of the code, to avoid double bookkeeping of whether a character can collide/hook/hit others, as this easily leads to problems. For example: m_Hook/m_NoHookHit in CCharacterCore, m_Hit in CCharacter vs NoHammerHit (etc), and also fake tunings that in some cases are no longer required for ddnet clients. ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: trml <trml@users.noreply.github.com>
This commit is contained in:
commit
8a818439b0
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue