mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
M_AssignSprayCans: Don't handle the prepended cans in reverse order
Was messing around with part-duplicating this code for Prison Egg CDs, and realised a corruption/overwriting bug if you had more freebie Spray Cans than the standard ones.
This commit is contained in:
parent
46dcfe0000
commit
2cc796a042
1 changed files with 6 additions and 5 deletions
11
src/m_cond.c
11
src/m_cond.c
|
|
@ -806,14 +806,15 @@ static void M_AssignSpraycans(void)
|
||||||
M_Shuffle_UINT16(tempcanlist + prependoffset - (prependlen - 1), prependlen);
|
M_Shuffle_UINT16(tempcanlist + prependoffset - (prependlen - 1), prependlen);
|
||||||
|
|
||||||
// Put at the front of the main list
|
// Put at the front of the main list
|
||||||
// (technically reverses the prepend order, but it
|
// (technically messes with the main order, but it
|
||||||
// was LITERALLY just shuffled so it doesn't matter)
|
// was LITERALLY just shuffled so it doesn't matter)
|
||||||
while (prependlen)
|
i = 0;
|
||||||
|
while (i < prependlen)
|
||||||
{
|
{
|
||||||
prependlen--;
|
tempcanlist[listlen] = tempcanlist[i];
|
||||||
tempcanlist[listlen] = tempcanlist[prependlen];
|
tempcanlist[i] = tempcanlist[prependoffset - i];
|
||||||
tempcanlist[prependlen] = tempcanlist[prependoffset - prependlen];
|
|
||||||
listlen++;
|
listlen++;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue