6142: Adjust no weak prediction to updated server code r=def- a=Jupeyy

Tho i didnt see a wrong prediction with hook which probably makes sense, it probs only affects weapons, as thats the main part the server code was updated for

## 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 (especially base/) or added coverage to integration test
- [ ] 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: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
bors[bot] 2022-12-15 17:45:50 +00:00 committed by GitHub
commit 2d57e0455a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,24 +188,29 @@ bool distCompare(std::pair<float, int> a, std::pair<float, int> b)
void CGameWorld::Tick()
{
// update all objects
if(m_WorldConfig.m_NoWeakHookAndBounce)
for(int i = 0; i < NUM_ENTTYPES; i++)
{
for(auto *pEnt : m_apFirstEntityTypes)
// It's important to call PreTick() and Tick() after each other.
// If we call PreTick() before, and Tick() after other entities have been processed, it causes physics changes such as a stronger shotgun or grenade.
if(m_WorldConfig.m_NoWeakHookAndBounce && i == ENTTYPE_CHARACTER)
{
auto *pEnt = m_apFirstEntityTypes[i];
for(; pEnt;)
{
m_pNextTraverseEntity = pEnt->m_pNextTypeEntity;
pEnt->PreTick();
((CCharacter *)pEnt)->PreTick();
pEnt = m_pNextTraverseEntity;
}
}
}
for(auto *pEnt : m_apFirstEntityTypes)
auto *pEnt = m_apFirstEntityTypes[i];
for(; pEnt;)
{
m_pNextTraverseEntity = pEnt->m_pNextTypeEntity;
pEnt->Tick();
pEnt = m_pNextTraverseEntity;
}
}
for(auto *pEnt : m_apFirstEntityTypes)
for(; pEnt;)