mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #4288
4288: Fix characters disappearing (fixes #4285) r=def- a=fokkonaut Doesnt change entity types order or adds new ones, because `@trml` didnt want that to not change physics at all (might have negative side effects which I personally couldnt see in my mod, where I have custom enttypes for doors, draggers, etc...) ## 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 - [ ] 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: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
This commit is contained in:
commit
29c376cf55
|
@ -106,13 +106,25 @@ void CGameWorld::RemoveEntity(CEntity *pEnt)
|
|||
//
|
||||
void CGameWorld::Snap(int SnappingClient)
|
||||
{
|
||||
for(auto *pEnt : m_apFirstEntityTypes)
|
||||
for(; pEnt;)
|
||||
for(CEntity *pEnt = m_apFirstEntityTypes[ENTTYPE_CHARACTER]; pEnt;)
|
||||
{
|
||||
m_pNextTraverseEntity = pEnt->m_pNextTypeEntity;
|
||||
pEnt->Snap(SnappingClient);
|
||||
pEnt = m_pNextTraverseEntity;
|
||||
}
|
||||
|
||||
for(int i = 0; i < NUM_ENTTYPES; i++)
|
||||
{
|
||||
if(i == ENTTYPE_CHARACTER)
|
||||
continue;
|
||||
|
||||
for(CEntity *pEnt = m_apFirstEntityTypes[i]; pEnt;)
|
||||
{
|
||||
m_pNextTraverseEntity = pEnt->m_pNextTypeEntity;
|
||||
pEnt->Snap(SnappingClient);
|
||||
pEnt = m_pNextTraverseEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGameWorld::Reset()
|
||||
|
|
Loading…
Reference in a new issue