mirror of https://github.com/OpenRCT2/OpenRCT2.git
Read hasShelter property from station object
This commit is contained in:
parent
1feaf19f89
commit
14275f3be4
|
@ -95,6 +95,7 @@ void StationObject::ReadJson(IReadObjectContext* context, json_t& root)
|
|||
{ "hasSecondaryColour", STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR },
|
||||
{ "isTransparent", STATION_OBJECT_FLAGS::IS_TRANSPARENT },
|
||||
{ "noPlatforms", STATION_OBJECT_FLAGS::NO_PLATFORMS },
|
||||
{ "hasShelter", STATION_OBJECT_FLAGS::HAS_SHELTER },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace STATION_OBJECT_FLAGS
|
|||
const uint32_t HAS_SECONDARY_COLOUR = 1 << 1;
|
||||
const uint32_t IS_TRANSPARENT = 1 << 2;
|
||||
const uint32_t NO_PLATFORMS = 1 << 3;
|
||||
const uint32_t HAS_SHELTER = (1 << 4);
|
||||
} // namespace STATION_OBJECT_FLAGS
|
||||
|
||||
class StationObject final : public Object
|
||||
|
|
|
@ -5417,12 +5417,7 @@ bool ride_has_adjacent_station(Ride* ride)
|
|||
bool ride_has_station_shelter(Ride* ride)
|
||||
{
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
// The server might run in headless mode so no images will be loaded, only check for stations.
|
||||
return stationObj != nullptr;
|
||||
}
|
||||
return stationObj != nullptr && stationObj->BaseImageId != 0;
|
||||
return stationObj != nullptr && (stationObj->Flags & STATION_OBJECT_FLAGS::HAS_SHELTER);
|
||||
}
|
||||
|
||||
bool ride_has_ratings(const Ride* ride)
|
||||
|
|
Loading…
Reference in New Issue