From 3bc26f2e7536031ad2ea3486048b8bd2c931c100 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 03:08:18 -0400 Subject: [PATCH 1/3] Disable error messages while fuzzing --- src/sdl/i_system.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index ae2c35d5c..d766b80bf 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1769,7 +1769,8 @@ void I_Error(const char *error, ...) // Implement message box with SDL_ShowSimpleMessageBox, // which should fail gracefully if it can't put a message box up // on the target system - if (!M_CheckParm("-dedicated")) + extern consvar_t cv_fuzz; + if (!M_CheckParm("-dedicated") && !(cv_fuzz.value)) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Dr. Robotnik's Ring Racers " VERSIONSTRING " Recursive Error", buffer, NULL); @@ -1814,7 +1815,9 @@ void I_Error(const char *error, ...) I_ShutdownGraphics(); I_ShutdownInput(); - I_ShowErrorMessageBox(buffer, false); + extern consvar_t cv_fuzz; + if (!cv_fuzz.value) + I_ShowErrorMessageBox(buffer, false); // We wait until now to do this so the funny sound can be heard I_ShutdownSound(); From 1d6ade51ae0901d0e4d12e0c3df075187bc58f3d Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 02:17:45 -0400 Subject: [PATCH 2/3] Fix use-after-remove when bailing with attracting rings --- src/k_kart.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 43f26ac71..0aa3b9c6b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -14193,8 +14193,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // really silly stupid dumb HACK to fix interp // without needing to duplicate any code A_AttractChase(ring); - P_SetOrigin(ring, ring->x, ring->y, ring->z); - ring->extravalue1 = 1; + + // ring can be removed if the player is in a state that explicitly blocks ring pickup + // try not to go crazy for a week figuring out why bail randomly crashes :)))))) + if (ring && !P_MobjWasRemoved(ring)) + { + P_SetOrigin(ring, ring->x, ring->y, ring->z); + ring->extravalue1 = 1; + } + UINT8 dumprate = 3; From 249d97dbec14a40428ee391a3c18407754307a6e Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 11:21:22 -0400 Subject: [PATCH 3/3] Fuzz fixups --- src/d_clisrv.c | 2 +- src/k_kart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index d59435aa3..4581f164c 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5395,7 +5395,7 @@ static void FuzzTiccmd(ticcmd_t* target) target->forwardmove = P_RandomRange(PR_FUZZ, -MAXPLMOVE, MAXPLMOVE); target->turning = P_RandomRange(PR_FUZZ, -KART_FULLTURN, KART_FULLTURN); target->throwdir = P_RandomRange(PR_FUZZ, -KART_FULLTURN, KART_FULLTURN); - target->buttons = P_RandomRange(PR_FUZZ, 0, 255); + target->buttons = P_RandomRange(PR_FUZZ, 0, 65535); // Make fuzzed players more likely to do impactful things if (P_RandomRange(PR_FUZZ, 0, 500)) diff --git a/src/k_kart.c b/src/k_kart.c index 0aa3b9c6b..c605596de 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10599,7 +10599,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) } extern consvar_t cv_fuzz; - if (cv_fuzz.value && P_CanPickupItem(player, PICKUP_ITEMBOX)) + if (cv_fuzz.value && player->itemamount == 0 && !player->itemRoulette.active) { K_StartItemRoulette(player, P_RandomRange(PR_FUZZ, 0, 1)); }