1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Fix #4415: Rides that change colours each train were incorrectly loaded causing all same colour

Mistake caused by new object loader not reproducing legacy technique used to indicate that a ride is a change colour each train type.
This commit is contained in:
Duncan
2016-09-12 20:11:43 +01:00
committed by Ted John
parent a2bf35eee5
commit b4ca0c3508

View File

@@ -90,11 +90,16 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
// Read preset colours, by default there are 32
_presetColours.count = stream->ReadValue<uint8>();
if (_presetColours.count == 255)
int coloursCount = _presetColours.count;
// To indicate a ride has different colours each train the count
// is set to 255. There are only actually 32 colours though.
if (coloursCount == 255)
{
_presetColours.count = 32;
coloursCount = 32;
}
for (uint8 i = 0; i < _presetColours.count; i++)
for (uint8 i = 0; i < coloursCount; i++)
{
_presetColours.list[i] = stream->ReadValue<vehicle_colour>();
}