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:
Robert Müller 2024-04-16 20:30:58 +02:00
parent d028756bbb
commit 36db1e604f

View file

@ -2167,7 +2167,7 @@ bool CCharacter::Freeze(int Seconds)
{ {
if(Seconds <= 0 || m_Core.m_Super || m_FreezeTime > Seconds * Server()->TickSpeed()) if(Seconds <= 0 || m_Core.m_Super || m_FreezeTime > Seconds * Server()->TickSpeed())
return false; 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_Armor = 0;
m_FreezeTime = Seconds * Server()->TickSpeed(); m_FreezeTime = Seconds * Server()->TickSpeed();