mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
M_GetNextAchievedUnlock: Correctly handle reaching the Chao Key limit
This commit is contained in:
parent
7c91f768d8
commit
7d4efd6629
1 changed files with 14 additions and 4 deletions
18
src/m_cond.c
18
src/m_cond.c
|
|
@ -1806,10 +1806,20 @@ UINT16 M_GetNextAchievedUnlock(boolean canskipchaokeys)
|
||||||
if (canskipchaokeys == true)
|
if (canskipchaokeys == true)
|
||||||
{
|
{
|
||||||
// Okay, we're skipping chao keys - let's just insta-digest them.
|
// Okay, we're skipping chao keys - let's just insta-digest them.
|
||||||
gamedata->chaokeys += gamedata->keyspending;
|
|
||||||
gamedata->pendingkeyroundoffset =
|
if (gamedata->chaokeys + gamedata->keyspending < GDMAX_CHAOKEYS)
|
||||||
(gamedata->pendingkeyroundoffset + gamedata->pendingkeyrounds)
|
{
|
||||||
% GDCONVERT_ROUNDSTOKEY;
|
gamedata->chaokeys += gamedata->keyspending;
|
||||||
|
gamedata->pendingkeyroundoffset =
|
||||||
|
(gamedata->pendingkeyroundoffset + gamedata->pendingkeyrounds)
|
||||||
|
% GDCONVERT_ROUNDSTOKEY;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gamedata->chaokeys = GDMAX_CHAOKEYS;
|
||||||
|
gamedata->pendingkeyroundoffset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
gamedata->keyspending = 0;
|
gamedata->keyspending = 0;
|
||||||
gamedata->pendingkeyrounds = 0;
|
gamedata->pendingkeyrounds = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue