clamp m_Armor, to prevent value correction on client side

This commit is contained in:
c0d3d3v 2022-06-25 16:06:22 +02:00
parent 4281df2429
commit 706a06d4d4
No known key found for this signature in database
GPG key ID: 068AF680530DFF31

View file

@ -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();