mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Fix freeze not working during first 50 server ticks
The purpose of this condition is to only update the freeze time every 50 ticks so the freeze bar keeps being refilled after one second when standing in freeze, but it incorrectly prevented freeze from being applied during the first 50 ticks after the map has been loaded. Now, freeze is also applied if not currently frozen, so the behavior directly after changing the map is identical to subsequent respawns.
This commit is contained in:
parent
d028756bbb
commit
36db1e604f
|
@ -2167,7 +2167,7 @@ bool CCharacter::Freeze(int Seconds)
|
|||
{
|
||||
if(Seconds <= 0 || m_Core.m_Super || m_FreezeTime > Seconds * Server()->TickSpeed())
|
||||
return false;
|
||||
if(m_Core.m_FreezeStart < Server()->Tick() - Server()->TickSpeed())
|
||||
if(m_FreezeTime == 0 || m_Core.m_FreezeStart < Server()->Tick() - Server()->TickSpeed())
|
||||
{
|
||||
m_Armor = 0;
|
||||
m_FreezeTime = Seconds * Server()->TickSpeed();
|
||||
|
|
Loading…
Reference in a new issue