mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #6142
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:
commit
2d57e0455a
|
@ -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;)
|
||||
|
|
Loading…
Reference in a new issue