From aed991aa881bc9813a534977c9532f38f0c7dd6a Mon Sep 17 00:00:00 2001 From: Nexius Date: Thu, 29 Aug 2024 20:36:52 +0300 Subject: [PATCH] Validate camera modes better --- Server/Source/player_pool.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Server/Source/player_pool.hpp b/Server/Source/player_pool.hpp index bf27fead0..52b8fae0f 100644 --- a/Server/Source/player_pool.hpp +++ b/Server/Source/player_pool.hpp @@ -869,8 +869,13 @@ struct PlayerPool final : public IPlayerPool, public NetworkEventHandler, public player.aimingData_.weaponState = PlayerWeaponState(aimSync.WeaponState); player.aimingData_.aspectRatio = (aimSync.AspectRatio * 1.f / 255) + 1.f; - // Fix for camera shaking hack, i think there are more bugged ids - if (aimSync.CamMode == 34u || aimSync.CamMode == 45u || aimSync.CamMode == 41u || aimSync.CamMode == 42u || aimSync.CamMode == 49u) + // Check for invalid camera modes + if (aimSync.CamMode < 0u || aimSync.CamMode > 65u) + aimSync.CamMode = 4u; + + // Fix for camera shaking hack + // https://gtag.sannybuilder.com/sanandreas/camera-modes/ + if (aimSync.CamMode == 5u || aimSync.CamMode == 34u || (aimSync.CamMode >= 39u && aimSync.CamMode <= 43u) || aimSync.CamMode == 45u || aimSync.CamMode == 49u || aimSync.CamMode == 52u) aimSync.CamMode = 4u; aimSync.PlayerID = player.poolID;