diff --git a/src/object/RideObject.cpp b/src/object/RideObject.cpp index ca6d6d975634..647c7d3b8e27 100644 --- a/src/object/RideObject.cpp +++ b/src/object/RideObject.cpp @@ -108,6 +108,7 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream) numPeepLoadingPositions = stream->ReadValue(); } _peepLoadingPositions[i] = stream->ReadArray(numPeepLoadingPositions); + _legacyType.vehicles[i].peep_loading_positions_size = numPeepLoadingPositions; } GetImageTable()->Read(context, stream); diff --git a/src/peep/peep.c b/src/peep/peep.c index f2f85dd6dd7f..f45399e981be 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -2251,6 +2251,7 @@ static void peep_update_ride_sub_state_1(rct_peep* peep){ return; } + assert(peep->current_seat < vehicle_type->peep_loading_positions_size); sint8 load_position = vehicle_type->peep_loading_positions[peep->current_seat]; switch (vehicle->sprite_direction / 8){ diff --git a/src/ride/ride.h b/src/ride/ride.h index 8cfa2cec455c..b391ed7e558b 100644 --- a/src/ride/ride.h +++ b/src/ride/ride.h @@ -122,9 +122,6 @@ typedef struct rct_ride_entry { uint8 shop_item; // 0x1C0 uint8 shop_item_secondary; // 0x1C1 } rct_ride_entry; -#ifdef PLATFORM_32BIT -assert_struct_size(rct_ride_entry, 0x1c2); -#endif /** * Ride structure. diff --git a/src/ride/vehicle.h b/src/ride/vehicle.h index dcc59c0cefa1..1576224ff1bd 100644 --- a/src/ride/vehicle.h +++ b/src/ride/vehicle.h @@ -76,10 +76,9 @@ typedef struct rct_ride_entry_vehicle { uint8 draw_order; uint8 special_frames; // 0x60 , 0x7A sint8* peep_loading_positions; // 0x61 , 0x7B + uint8 peep_loading_positions_size; } rct_ride_entry_vehicle; -#ifdef PLATFORM_32BIT -assert_struct_size(rct_ride_entry_vehicle, 0x65); -#endif + typedef struct rct_vehicle { uint8 sprite_identifier; // 0x00