From 66e9f59a284a12fcf5f0c8833578189057f45693 Mon Sep 17 00:00:00 2001 From: Evan Ramos Date: Tue, 4 Jun 2024 07:46:21 -0500 Subject: [PATCH] Rednukem: Fix `-s` command line parameter with values >= 5 when valid Fixes nukeykt/NBlood#817 --- source/rr/src/cmdline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/rr/src/cmdline.cpp b/source/rr/src/cmdline.cpp index 6268f6294b..36f4ab3a4f 100644 --- a/source/rr/src/cmdline.cpp +++ b/source/rr/src/cmdline.cpp @@ -669,7 +669,7 @@ void G_CheckCommandLine(int32_t argc, char const * const * argv) break; case 's': c++; - ud.m_player_skill = ud.player_skill = (Batoi(c)%5); + ud.m_player_skill = ud.player_skill = clamp(Batoi(c), 0, g_skillCnt); if (ud.m_player_skill == 4) ud.m_respawn_monsters = ud.respawn_monsters = 1; break;