3800: Get rid of current tuning in predicted world r=Jupeyy a=TsFreddie

Missed a spot where the predicted world still returns current tuning.
closes #3799 

## Checklist

- [x] 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
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] 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: Freddie Wang <tsfreddiewang@gmail.com>
This commit is contained in:
bors[bot] 2021-05-01 19:05:02 +00:00 committed by GitHub
commit cd19e22959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View file

@ -2241,8 +2241,8 @@ void CGameClient::UpdatePrediction()
// 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;
m_GameWorld.m_Core.m_Tuning[g_Config.m_ClDummy].m_PlayerCollision = 1;
m_GameWorld.m_Core.m_Tuning[g_Config.m_ClDummy].m_PlayerHooking = 1;
}
// restore characters from previously saved ones if they temporarily left the snapshot

View file

@ -289,7 +289,7 @@ void CGameWorld::ReleaseHooked(int ClientID)
CTuningParams *CGameWorld::Tuning()
{
return &m_Tuning[g_Config.m_ClDummy];
return &m_Core.m_Tuning[g_Config.m_ClDummy];
}
CEntity *CGameWorld::GetEntity(int ID, int EntType)
@ -531,7 +531,6 @@ void CGameWorld::CopyWorld(CGameWorld *pFrom)
for(int i = 0; i < 2; i++)
{
m_Core.m_Tuning[i] = pFrom->m_Core.m_Tuning[i];
m_Tuning[i] = pFrom->m_Tuning[i];
}
m_pTuningList = pFrom->m_pTuningList;
m_Teams = pFrom->m_Teams;

View file

@ -90,10 +90,9 @@ public:
CEntity *FindMatch(int ObjID, int ObjType, const void *pObjData);
void Clear();
CTuningParams m_Tuning[2];
CTuningParams *m_pTuningList;
CTuningParams *TuningList() { return m_pTuningList; }
CTuningParams *GetTuning(int i) { return i == 0 ? Tuning() : &TuningList()[i]; }
CTuningParams *GetTuning(int i) { return &TuningList()[i]; }
private:
void RemoveEntities();