mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix off-by-one errors in item odds, and add a little assert to make an assumption in this function that was being violated more explicit.
This commit is contained in:
parent
b5f582ed5a
commit
cd53f3da1f
1 changed files with 5 additions and 3 deletions
|
|
@ -616,7 +616,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
|
||||||
UINT8 pingame = 0, pexiting = 0, pinvin = 0;
|
UINT8 pingame = 0, pexiting = 0, pinvin = 0;
|
||||||
SINT8 first = -1, second = -1;
|
SINT8 first = -1, second = -1;
|
||||||
INT32 secondist = 0;
|
INT32 secondist = 0;
|
||||||
boolean itemenabled[NUMKARTRESULTS] = {
|
boolean itemenabled[NUMKARTRESULTS-1] = {
|
||||||
cv_sneaker.value,
|
cv_sneaker.value,
|
||||||
cv_rocketsneaker.value,
|
cv_rocketsneaker.value,
|
||||||
cv_invincibility.value,
|
cv_invincibility.value,
|
||||||
|
|
@ -640,7 +640,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
|
||||||
cv_dualjawz.value
|
cv_dualjawz.value
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!itemenabled[item] && !modeattacking)
|
I_Assert(item > KITEM_NONE); // too many off by one scenarioes.
|
||||||
|
|
||||||
|
if (!itemenabled[item-1] && !modeattacking)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (G_BattleGametype())
|
if (G_BattleGametype())
|
||||||
|
|
@ -761,7 +763,7 @@ static INT32 K_FindUseodds(player_t *player, fixed_t mashed, INT32 pingame, INT3
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < NUMKARTRESULTS; j++)
|
for (j = 1; j < NUMKARTRESULTS; j++)
|
||||||
{
|
{
|
||||||
if (K_KartGetItemOdds(i, j, mashed) > 0)
|
if (K_KartGetItemOdds(i, j, mashed) > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue