Fix numlaps 0 crash

Doesn't award exp proper on crossing position line but at least it doesnt crash
This commit is contained in:
Ashnal 2025-04-29 22:23:22 -04:00
parent bf6a5babfb
commit 4db9773488

View file

@ -15500,7 +15500,7 @@ UINT16 K_GetDisplayEXP(player_t *player)
// target is where you should be if you're doing good and at a 1.0 mult
fixed_t clampedexp = max(FRACUNIT/2, min(FRACUNIT*5/4, player->exp)); // clamp between 0.5 and 1.25
fixed_t targetdisplayexp = (TARGETDISPLAYEXP*player->gradingpointnum/numgradingpoints)<<FRACBITS;
fixed_t targetdisplayexp = (TARGETDISPLAYEXP*player->gradingpointnum/max(1,numgradingpoints))<<FRACBITS;
UINT16 displayexp = FixedMul(clampedexp, targetdisplayexp)>>FRACBITS;
return displayexp;