Merge branch 'better-fuzz' into 'master'

Fuzz fixups

See merge request kart-krew-dev/ring-racers-internal!2668
This commit is contained in:
AJ Martinez 2025-07-04 17:40:28 +00:00
commit 5e92d74f81
3 changed files with 16 additions and 6 deletions

View file

@ -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))

View file

@ -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));
}
@ -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;

View file

@ -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();