Don't overflow when scaling large netgame distances

This commit is contained in:
Antonio Martinez 2024-08-21 21:24:00 -07:00
parent 69e37fe40b
commit cd4bef9f24

View file

@ -1389,8 +1389,8 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet
// 5: Skim any items that are much weaker than the reel's average out of the roulette
// 6: Cram it all in
fixed_t largegamescaler = FRACUNIT + (roulette->playing * (6*FRACUNIT/100)); // Spread out item odds in large games for a less insane experience.
UINT32 targetpower = FixedInt(FixedDiv(roulette->dist*FRACUNIT, largegamescaler)); // fill roulette with items around this value!
fixed_t largegamescaler = roulette->playing * 6 + 100; // Spread out item odds in large games for a less insane experience.
UINT32 targetpower = 100 * roulette->dist / largegamescaler; // fill roulette with items around this value!
UINT32 powers[NUMKARTRESULTS]; // how strong is each item? think of this as a "target distance" for this item to spawn at
UINT32 deltas[NUMKARTRESULTS]; // how different is that strength from target?