mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-30 19:52:43 +00:00
Fix the Hanagumi Hall ring vent overflow
The way the cap was being handled was kind of messed up, and was trying to subtract your existing Super Ring count. But because the datatype doesn't support negative numbers, it rolled under to approx UINT16_MAX! Fix the datatypes and add the extra over-range check to prevent this from happening again.
This commit is contained in:
parent
429f84f6b6
commit
263c968cc8
2 changed files with 6 additions and 2 deletions
|
|
@ -3650,7 +3650,7 @@ angle_t K_MomentumAngleReal(const mobj_t *mo)
|
|||
}
|
||||
}
|
||||
|
||||
void K_AwardPlayerRings(player_t *player, INT32 rings, boolean overload)
|
||||
void K_AwardPlayerRings(player_t *player, UINT16 rings, boolean overload)
|
||||
{
|
||||
UINT16 superring;
|
||||
|
||||
|
|
@ -3661,7 +3661,11 @@ void K_AwardPlayerRings(player_t *player, INT32 rings, boolean overload)
|
|||
|
||||
/* capped at 20 rings */
|
||||
if ((totalrings + rings) > 20)
|
||||
{
|
||||
if (totalrings >= 20)
|
||||
return; // woah dont let that go negative buster
|
||||
rings = (20 - totalrings);
|
||||
}
|
||||
}
|
||||
|
||||
superring = player->superring + rings;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ void K_KartPlayerAfterThink(player_t *player);
|
|||
angle_t K_MomentumAngleEx(const mobj_t *mo, const fixed_t threshold);
|
||||
angle_t K_MomentumAngleReal(const mobj_t *mo);
|
||||
#define K_MomentumAngle(mo) K_MomentumAngleEx(mo, 6 * mo->scale)
|
||||
void K_AwardPlayerRings(player_t *player, INT32 rings, boolean overload);
|
||||
void K_AwardPlayerRings(player_t *player, UINT16 rings, boolean overload);
|
||||
void K_DoInstashield(player_t *player);
|
||||
void K_DoPowerClash(mobj_t *t1, mobj_t *t2);
|
||||
void K_DoGuardBreak(mobj_t *t1, mobj_t *t2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue