From c7b2362a590e5ee07d535c6ad8d955e7443bdca3 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Wed, 3 Jan 2024 11:24:35 +0100 Subject: [PATCH] properly error out of G_NextWeapon() in case of error --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index f46569a9..7a4d0733 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -295,7 +295,7 @@ static int G_NextWeapon(int direction) if (i == arrlen(weapon_order_table)) { - return wp_nochange; + I_Error("G_NextWeapon: Invalid weapon type %d", (int)weapon); } // Switch weapon. Don't loop forever.