This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
Revisión | bb1317a6f4aca6ab5e3a9b6d36801ab5f9537faf (tree) |
---|---|
Tiempo | 2022-10-09 23:51:01 |
Autor | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Made a minor change in how the value of sv_maxlives gets clamped.
@@ -79,10 +79,17 @@ | ||
79 | 79 | |
80 | 80 | CUSTOM_CVAR( Int, sv_maxlives, 0, CVAR_SERVERINFO | CVAR_LATCH | CVAR_GAMEPLAYSETTING ) |
81 | 81 | { |
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 | + { | |
85 | 90 | self = 0; |
91 | + return; | |
92 | + } | |
86 | 93 | |
87 | 94 | // [AK] Notify the clients about the change. |
88 | 95 | SERVER_SettingChanged( self, false ); |