Commit MetaInfo

修订版a3115fc55f31c49a5fb7838608d064edcfbfab02 (tree)
时间2021-12-06 05:31:54
作者Benjamin Berkels <torr.samaho@quan...>
CommiterBenjamin Berkels

Log Message

Added some missing client side checks (fixing 3830 and 3828). Kudos to mmmds for reporting these problems.

更改概述

差异

diff -r 669df2dc2c65 -r a3115fc55f31 src/cl_main.cpp
--- a/src/cl_main.cpp Sat Dec 04 13:03:57 2021 -0500
+++ b/src/cl_main.cpp Sun Dec 05 21:31:54 2021 +0100
@@ -3494,7 +3494,7 @@
34943494 const BYTE oldPlayerClass = pPlayer->CurrentPlayerClass;
34953495
34963496 // Set up the player class.
3497- pPlayer->CurrentPlayerClass = playerClass;
3497+ pPlayer->CurrentPlayerClass = clamp<int>( playerClass, 0, PlayerClasses.Size() -1 );
34983498 pPlayer->cls = PlayerClasses[pPlayer->CurrentPlayerClass].Type;
34993499
35003500 if ( isMorphed )
@@ -5787,7 +5787,7 @@
57875787 UCVarValue Value;
57885788
57895789 // Read in the gameskill setting, and set gameskill to this setting.
5790- Value.Int = pByteStream->ReadByte();
5790+ Value.Int = clamp<int>( pByteStream->ReadByte(), 0, AllSkills.Size() - 1);
57915791 gameskill.ForceSet( Value, CVAR_Int );
57925792
57935793 // Do the same for botskill.
Show on old repository browser