mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-01 11:15:13 +01:00
Allow cars property to be a single object
This commit is contained in:
@@ -125,6 +125,8 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
|
||||
|
||||
void RideObject::Load()
|
||||
{
|
||||
_legacyType.obj = this;
|
||||
|
||||
GetStringTable().Sort();
|
||||
_legacyType.naming.name = language_allocate_object_string(GetName());
|
||||
_legacyType.naming.description = language_allocate_object_string(GetDescription());
|
||||
@@ -709,11 +711,20 @@ void RideObject::ReadJsonVehicleInfo(IReadObjectContext * context, const json_t
|
||||
std::vector<rct_ride_entry_vehicle> RideObject::ReadJsonCars(const json_t * jCars)
|
||||
{
|
||||
std::vector<rct_ride_entry_vehicle> cars;
|
||||
json_t * jCar;
|
||||
size_t index;
|
||||
json_array_foreach(jCars, index, jCar)
|
||||
|
||||
if (json_is_array(jCars))
|
||||
{
|
||||
auto car = ReadJsonCar(jCar);
|
||||
json_t * jCar;
|
||||
size_t index;
|
||||
json_array_foreach(jCars, index, jCar)
|
||||
{
|
||||
auto car = ReadJsonCar(jCar);
|
||||
cars.push_back(car);
|
||||
}
|
||||
}
|
||||
else if (json_is_object(jCars))
|
||||
{
|
||||
auto car = ReadJsonCar(jCars);
|
||||
cars.push_back(car);
|
||||
}
|
||||
return cars;
|
||||
|
||||
@@ -126,6 +126,7 @@ struct rct_ride_entry {
|
||||
uint8 shop_item; // 0x1C0
|
||||
uint8 shop_item_secondary; // 0x1C1
|
||||
rct_string_id capacity;
|
||||
void * obj;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
Reference in New Issue
Block a user