From 36db1e604f05b217061512f4eb7405c95ef416e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 16 Apr 2024 20:30:58 +0200 Subject: [PATCH] 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. --- src/game/server/entities/character.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 623b1805c..a1305937b 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -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();