From 540978570abbedfa8cfefa43e470169566ec0464 Mon Sep 17 00:00:00 2001 From: Anonimus Date: Fri, 7 Nov 2025 06:20:40 -0500 Subject: [PATCH] Kill voidptrs --- src/k_items.c | 2 +- src/k_items.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_items.c b/src/k_items.c index 1f109f996..cc3829112 100644 --- a/src/k_items.c +++ b/src/k_items.c @@ -960,7 +960,7 @@ INT32 K_KartGetItemOdds( // This item has unique odds! //CONS_Printf("Unique odds found. Assigning uoddsfunc..."); - uoddsfunc = (useoddsfunc_t)result->unique_odds[oddstable][result->format]; + uoddsfunc = result->unique_odds[oddstable][result->format]; //CONS_Printf("Running..."); newodds = uoddsfunc(result, playerpos, pdis, newodds, pos, pingame, pexiting, firstDist, ourDist, clusterDist, mashed, spbrush, bot, rival, inBottom); diff --git a/src/k_items.h b/src/k_items.h index 8fddee016..21b6c0dde 100644 --- a/src/k_items.h +++ b/src/k_items.h @@ -120,7 +120,7 @@ enum // Unique useodds function: // uoddsfunc(result, playerpos, pdis, newodds, pos, pingame, pexiting, firstDist, ourDist, clusterDist, mashed, spbrush, bot, rival, inBottom) // FIXME: This is fucking gross; is there not a better way to do this? -typedef INT32(*useoddsfunc_t)(void *, SINT8, UINT32, INT32, UINT8, UINT8, UINT8, UINT32, UINT32, UINT32, fixed_t, boolean, boolean, boolean, boolean); +typedef INT32(*useoddsfunc_t)(kartresult_t *, SINT8, UINT32, INT32, UINT8, UINT8, UINT8, UINT32, UINT32, UINT32, fixed_t, boolean, boolean, boolean, boolean); struct kartresult_t { @@ -138,7 +138,7 @@ struct kartresult_t // Functions that tell the game to use unique means of rolling these items. // If NULL, the functions never execute. - void *unique_odds[MAXODDSTABLES][NUMKARTITEMFORMATS]; + useoddsfunc_t unique_odds[MAXODDSTABLES][NUMKARTITEMFORMATS]; UINT8 flags[NUMKARTITEMFORMATS]; tic_t basebgone, bgone;