Read hasShelter property from station object

This commit is contained in:
Gymnasiast 2021-10-27 11:46:07 +02:00
parent 1feaf19f89
commit 14275f3be4
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
3 changed files with 3 additions and 6 deletions

View File

@ -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 },
});
}

View File

@ -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

View File

@ -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)