mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
M_ChallengesTick: Speed up digesting pending rounds into Chao Keys if there's lots of them remaining
This commit is contained in:
parent
1fb0e0454f
commit
276b19e871
1 changed files with 18 additions and 2 deletions
|
|
@ -344,12 +344,28 @@ void M_ChallengesTick(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(--gamedata->pendingkeyrounds & 1))
|
UINT32 keyexchange = gamedata->keyspending;
|
||||||
|
|
||||||
|
if (keyexchange > gamedata->pendingkeyrounds)
|
||||||
|
{
|
||||||
|
keyexchange = 1;
|
||||||
|
}
|
||||||
|
else if (keyexchange >= GDCONVERT_ROUNDSTOKEY/2)
|
||||||
|
{
|
||||||
|
keyexchange = GDCONVERT_ROUNDSTOKEY/2;
|
||||||
|
}
|
||||||
|
|
||||||
|
keyexchange |= 1; // guarantee an odd delta for the sake of the sound
|
||||||
|
|
||||||
|
gamedata->pendingkeyrounds -= keyexchange;
|
||||||
|
gamedata->pendingkeyroundoffset += keyexchange;
|
||||||
|
|
||||||
|
if (!(gamedata->pendingkeyrounds & 1))
|
||||||
{
|
{
|
||||||
S_StartSound(NULL, sfx_ptally);
|
S_StartSound(NULL, sfx_ptally);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++gamedata->pendingkeyroundoffset >= GDCONVERT_ROUNDSTOKEY)
|
if (gamedata->pendingkeyroundoffset >= GDCONVERT_ROUNDSTOKEY)
|
||||||
{
|
{
|
||||||
gamedata->pendingkeyroundoffset %= GDCONVERT_ROUNDSTOKEY;
|
gamedata->pendingkeyroundoffset %= GDCONVERT_ROUNDSTOKEY;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue