From 706a06d4d4840a6dea2f33c6850b976e423403a5 Mon Sep 17 00:00:00 2001 From: c0d3d3v Date: Sat, 25 Jun 2022 16:06:22 +0200 Subject: [PATCH] clamp m_Armor, to prevent value correction on client side --- 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 230418bb5..4ba3ae373 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -2063,7 +2063,7 @@ void CCharacter::SetRescue() void CCharacter::DDRaceTick() { mem_copy(&m_Input, &m_SavedInput, sizeof(m_Input)); - m_Armor = (m_FreezeTime >= 0) ? 10 - (m_FreezeTime / 15) : 0; + m_Armor = (m_FreezeTime >= 0) ? clamp(10 - (m_FreezeTime / 15), 0, 10) : 0; if(m_Input.m_Direction != 0 || m_Input.m_Jump != 0) m_LastMove = Server()->Tick();