1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 08:14:38 +01:00

Merge pull request #11303 from Gymnasiast/refactor/station-index

Small cleanup of RideRatings.cpp and Compat.cpp
This commit is contained in:
Michael Steenbeek
2020-04-16 13:11:49 +02:00
committed by GitHub
2 changed files with 5 additions and 12 deletions

View File

@@ -1423,10 +1423,10 @@ static rating_tuple ride_ratings_get_drop_ratings(Ride* ride)
*/
static int32_t ride_ratings_get_scenery_score(Ride* ride)
{
auto i = ride_get_first_valid_station_start(ride);
auto stationIndex = ride_get_first_valid_station_start(ride);
CoordsXY location;
if (i == STATION_INDEX_NULL)
if (stationIndex == STATION_INDEX_NULL)
{
return 0;
}
@@ -1437,13 +1437,13 @@ static int32_t ride_ratings_get_scenery_score(Ride* ride)
}
else
{
location = ride->stations[i].Start;
location = ride->stations[stationIndex].Start;
}
int32_t z = tile_element_height(location);
// Check if station is underground, returns a fixed mediocre score since you can't have scenery underground
if (z > ride->stations[i].GetBaseZ())
if (z > ride->stations[stationIndex].GetBaseZ())
{
return 40;
}

View File

@@ -15,6 +15,7 @@
#include <openrct2/object/Object.h>
#include <openrct2/paint/tile_element/Paint.TileElement.h>
#include <openrct2/ride/Ride.h>
#include <openrct2/ride/Station.h>
#include <openrct2/ride/Track.h>
#include <openrct2/world/Location.hpp>
#include <openrct2/world/Sprite.h>
@@ -61,19 +62,11 @@ const TileCoordsXY TileDirectionDelta[] = {
};
// clang-format on
TileCoordsXYZD ride_get_entrance_location(const Ride* ride, const StationIndex stationIndex);
TileCoordsXYZD ride_get_exit_location(const Ride* ride, const StationIndex stationIndex);
uint8_t get_current_rotation()
{
return gCurrentRotation & 3;
}
const uint32_t construction_markers[] = {
COLOUR_DARK_GREEN << 19 | COLOUR_GREY << 24 | IMAGE_TYPE_REMAP, // White
2 << 19 | 0b110000 << 19 | IMAGE_TYPE_TRANSPARENT, // Translucent
};
int object_entry_group_counts[] = {
128, // rides
252, // small scenery