• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revisiónbb1317a6f4aca6ab5e3a9b6d36801ab5f9537faf (tree)
Tiempo2022-10-09 23:51:01
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Made a minor change in how the value of sv_maxlives gets clamped.

Cambiar Resumen

Diferencia incremental

diff -r ef07e2140416 -r bb1317a6f4ac src/gamemode.cpp
--- a/src/gamemode.cpp Sun Oct 09 10:48:31 2022 -0400
+++ b/src/gamemode.cpp Sun Oct 09 10:51:01 2022 -0400
@@ -79,10 +79,17 @@
7979
8080 CUSTOM_CVAR( Int, sv_maxlives, 0, CVAR_SERVERINFO | CVAR_LATCH | CVAR_GAMEPLAYSETTING )
8181 {
82- if ( self >= 256 )
83- self = 255;
84- if ( self < 0 )
82+ // [AK] Limit the maximum number of lives to 255. This should be more than enough.
83+ if ( self > UCHAR_MAX )
84+ {
85+ self = UCHAR_MAX;
86+ return;
87+ }
88+ else if ( self < 0 )
89+ {
8590 self = 0;
91+ return;
92+ }
8693
8794 // [AK] Notify the clients about the change.
8895 SERVER_SettingChanged( self, false );
Show on old repository browser