mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Merge pull request #8150 from furo321/freezebar-fix
Fix freeze bar not being correct after returning from pause
This commit is contained in:
commit
7e8dc57194
|
@ -2263,12 +2263,17 @@ void CCharacter::Pause(bool Pause)
|
|||
ResetHook();
|
||||
GameWorld()->ReleaseHooked(GetPlayer()->GetCid());
|
||||
}
|
||||
m_PausedTick = Server()->Tick();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Core.m_Vel = vec2(0, 0);
|
||||
GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCid()] = &m_Core;
|
||||
GameServer()->m_World.InsertEntity(this);
|
||||
if(m_Core.m_FreezeStart > 0 && m_PausedTick >= 0)
|
||||
{
|
||||
m_Core.m_FreezeStart += Server()->Tick() - m_PausedTick;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,6 +104,7 @@ private:
|
|||
|
||||
bool m_Alive;
|
||||
bool m_Paused;
|
||||
int m_PausedTick;
|
||||
int m_NeededFaketuning;
|
||||
|
||||
// weapon info
|
||||
|
|
Loading…
Reference in a new issue