mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
M_AssignSpraycans: Fix off-by-one in shuffled prepended colours causing crashes
The prepended colour list passed to M_Shuffle_UINT16 was off by one, leading to possible pollution of the region with an uninitialised value. For some reason, some people's machines guarantee clean stack memory on game startup, while other people's do not. This is why some people were crashing on Spray Can list generation and some weren't. The stack memory was DEFINITELY not clean by the time you could navigate to the gamedata clear menu, which is why that was crashing without fail.
This commit is contained in:
parent
9076b3c99b
commit
6d5770ff5a
1 changed files with 1 additions and 1 deletions
|
|
@ -746,7 +746,7 @@ static void M_AssignSpraycans(void)
|
|||
if (prependlen)
|
||||
{
|
||||
// Swap the early colours for random order
|
||||
M_Shuffle_UINT16(tempcanlist + prependoffset - prependlen, prependlen);
|
||||
M_Shuffle_UINT16(tempcanlist + prependoffset - (prependlen - 1), prependlen);
|
||||
|
||||
// Put at the front of the main list
|
||||
// (technically reverses the prepend order, but it
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue