Skip to content

Commit

Permalink
Invalid camera mode checks
Browse files Browse the repository at this point in the history
improve it once again, make a wider list
  • Loading branch information
NexiusTailer authored Oct 12, 2024
1 parent 0ac24ef commit 18f9f37
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Server/Source/player_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,15 @@ struct PlayerPool final : public IPlayerPool, public NetworkEventHandler, public
player.aimingData_.aspectRatio = (aimSync.AspectRatio * 1.f / 255) + 1.f;

// 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)
if (aimSync.CamMode < 3u || aimSync.CamMode == 5u || aimSync.CamMode == 6u ||
(aimSync.CamMode >= 9u && aimSync.CamMode <= 13u) || aimSync.CamMode == 17u ||
(aimSync.CamMode >= 19u && aimSync.CamMode <= 21u) ||
(aimSync.CamMode >= 23u && aimSync.CamMode <= 28u) ||
(aimSync.CamMode >= 30u && aimSync.CamMode <= 45u) ||
(aimSync.CamMode >= 48u && aimSync.CamMode <= 50u) ||
aimSync.CamMode == 52u || aimSync.CamMode == 54u ||
aimSync.CamMode == 60u || aimSync.CamMode == 61u || aimSync.CamMode > 64u)
aimSync.CamMode = 4u;

aimSync.PlayerID = player.poolID;
Expand Down

0 comments on commit 18f9f37

Please sign in to comment.