修订版 | a3115fc55f31c49a5fb7838608d064edcfbfab02 (tree) |
---|---|
时间 | 2021-12-06 05:31:54 |
作者 | Benjamin Berkels <torr.samaho@quan...> |
Commiter | Benjamin Berkels |
Added some missing client side checks (fixing 3830 and 3828). Kudos to mmmds for reporting these problems.
@@ -3494,7 +3494,7 @@ | ||
3494 | 3494 | const BYTE oldPlayerClass = pPlayer->CurrentPlayerClass; |
3495 | 3495 | |
3496 | 3496 | // Set up the player class. |
3497 | - pPlayer->CurrentPlayerClass = playerClass; | |
3497 | + pPlayer->CurrentPlayerClass = clamp<int>( playerClass, 0, PlayerClasses.Size() -1 ); | |
3498 | 3498 | pPlayer->cls = PlayerClasses[pPlayer->CurrentPlayerClass].Type; |
3499 | 3499 | |
3500 | 3500 | if ( isMorphed ) |
@@ -5787,7 +5787,7 @@ | ||
5787 | 5787 | UCVarValue Value; |
5788 | 5788 | |
5789 | 5789 | // 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); | |
5791 | 5791 | gameskill.ForceSet( Value, CVAR_Int ); |
5792 | 5792 | |
5793 | 5793 | // Do the same for botskill. |