Use StationIndex in many more places (#10992)

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2020-03-26 21:38:26 +01:00
1 parent 357044171d
commit cfb405f0ed
18 files changed
+106 -88

No files matched your search

+3 -3
View File
@@ -1609,7 +1609,7 @@ rct_window* window_ride_main_open(Ride* ride)
*
* rct2: 0x006ACCCE
*/
static rct_window* window_ride_open_station(Ride* ride, int32_t stationIndex)
static rct_window* window_ride_open_station(Ride* ride, StationIndex stationIndex)
{
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
return window_ride_main_open(ride);
@@ -1904,7 +1904,7 @@ static void window_ride_init_viewport(rct_window* w)
}
else if (eax >= ride->num_vehicles && eax < (ride->num_vehicles + ride->num_stations))
{
int32_t stationIndex = -1;
StationIndex stationIndex = STATION_INDEX_NULL;
int32_t count = eax - ride->num_vehicles;
do
{
@@ -2820,7 +2820,7 @@ static rct_string_id window_ride_get_status_station(rct_window* w, void* argumen
return STR_NONE;
int32_t count = w->ride.view - ride->num_vehicles - 1;
int32_t stationIndex = -1;
StationIndex stationIndex = STATION_INDEX_NULL;
rct_string_id stringId = 0;
do
+1 -3
View File
@@ -3663,8 +3663,6 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
*/
void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoords)
{
uint8_t stationNum;
map_invalidate_selection_rect();
map_invalidate_map_selection_tiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
@@ -3686,7 +3684,7 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor
map_invalidate_selection_rect();
entranceOrExitCoords.direction = direction_reverse(gRideEntranceExitPlaceDirection);
stationNum = gRideEntranceExitPlaceStationIndex;
StationIndex stationNum = gRideEntranceExitPlaceStationIndex;
if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT)
|| entranceOrExitCoords != gRideEntranceExitGhostPosition || stationNum != gRideEntranceExitGhostStationIndex)
{
@@ -24,13 +24,14 @@ private:
CoordsXY _loc;
Direction _direction;
NetworkRideId_t _rideIndex;
uint8_t _stationNum;
StationIndex _stationNum;
bool _isExit;
public:
RideEntranceExitPlaceAction() = default;
RideEntranceExitPlaceAction(const CoordsXY& loc, Direction direction, ride_id_t rideIndex, uint8_t stationNum, bool isExit)
RideEntranceExitPlaceAction(
const CoordsXY& loc, Direction direction, ride_id_t rideIndex, StationIndex stationNum, bool isExit)
: _loc(loc)
, _direction(direction)
, _rideIndex(rideIndex)
@@ -19,13 +19,13 @@ DEFINE_GAME_ACTION(RideEntranceExitRemoveAction, GAME_COMMAND_REMOVE_RIDE_ENTRAN
private:
CoordsXY _loc;
NetworkRideId_t _rideIndex;
uint8_t _stationNum;
StationIndex _stationNum;
bool _isExit;
public:
RideEntranceExitRemoveAction() = default;
RideEntranceExitRemoveAction(const CoordsXY& loc, ride_id_t rideIndex, uint8_t stationNum, bool isExit)
RideEntranceExitRemoveAction(const CoordsXY& loc, ride_id_t rideIndex, StationIndex stationNum, bool isExit)
: _loc(loc)
, _rideIndex(rideIndex)
, _stationNum(stationNum)
+2 -2
View File
@@ -4174,7 +4174,7 @@ void Guest::UpdateRideLeaveVehicle()
break;
}
uint8_t stationIndex = inner_map->AsTrack()->GetStationIndex();
auto stationIndex = inner_map->AsTrack()->GetStationIndex();
if (stationIndex == current_ride_station)
break;
}
@@ -4260,7 +4260,7 @@ void Guest::UpdateRideLeaveVehicle()
TileElement* trackElement = ride_get_station_start_track_element(ride, current_ride_station);
uint8_t station_direction = (trackElement == nullptr ? 0 : trackElement->GetDirection());
Direction station_direction = (trackElement == nullptr ? 0 : trackElement->GetDirection());
vehicle = GET_VEHICLE(ride->vehicles[current_train]);
+43 -22
View File
@@ -1839,6 +1839,44 @@ static void get_ride_queue_end(TileCoordsXYZ& loc)
loc.z = tileElement->base_height;
}
/*
* If a ride has multiple entrance stations and is set to sync with
* adjacent stations, cycle through the entrance stations (based on
* number of rides the peep has been on) so the peep will try the
* different sections of the ride.
* In this case, the ride's various entrance stations will typically,
* though not necessarily, be adjacent to one another and consequently
* not too far for the peep to walk when cycling between them.
* Note: the same choice of station must made while the peep navigates
* to the station. Consequently a truly random station selection here is not
* appropriate.
*/
static StationIndex guest_pathfinding_select_random_station(
const Guest* guest, int32_t numEntranceStations, std::bitset<MAX_STATIONS>& entranceStations)
{
int32_t select = guest->no_of_rides % numEntranceStations;
while (select > 0)
{
for (StationIndex i = 0; i < MAX_STATIONS; i++)
{
if (entranceStations[i])
{
entranceStations[i] = false;
select--;
break;
}
}
}
for (StationIndex i = 0; i < MAX_STATIONS; i++)
{
if (entranceStations[i])
{
return i;
}
}
return 0;
}
/**
*
* rct2: 0x00694C35
@@ -2051,19 +2089,19 @@ int32_t guest_path_finding(Guest* peep)
* At the same time, count how many entrance stations there are and
* which stations are entrance stations. */
auto bestScore = std::numeric_limits<int32_t>::max();
uint8_t closestStationNum = 0;
StationIndex closestStationNum = 0;
int32_t numEntranceStations = 0;
uint8_t entranceStations = 0;
std::bitset<MAX_STATIONS> entranceStations = {};
for (uint8_t stationNum = 0; stationNum < MAX_STATIONS; ++stationNum)
for (StationIndex stationNum = 0; stationNum < MAX_STATIONS; ++stationNum)
{
// Skip if stationNum has no entrance (so presumably an exit only station)
if (ride_get_entrance_location(ride, stationNum).isNull())
continue;
numEntranceStations++;
entranceStations |= (1 << stationNum);
entranceStations[stationNum] = true;
TileCoordsXYZD entranceLocation = ride_get_entrance_location(ride, stationNum);
auto score = CalculateHeuristicPathingScore(entranceLocation, TileCoordsXYZ{ peep->NextLoc });
@@ -2079,26 +2117,9 @@ int32_t guest_path_finding(Guest* peep)
if (numEntranceStations == 0)
closestStationNum = 0;
/* If a ride has multiple entrance stations and is set to sync with
* adjacent stations, cycle through the entrance stations (based on
* number of rides the peep has been on) so the peep will try the
* different sections of the ride.
* In this case, the ride's various entrance stations will typically,
* though not necessarily, be adjacent to one another and consequently
* not too far for the peep to walk when cycling between them.
* Note: the same choice of station must made while the peep navigates
* to the station. Consequently a random station selection here is not
* appropriate. */
if (numEntranceStations > 1 && (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS))
{
int32_t select = peep->no_of_rides % numEntranceStations;
while (select > 0)
{
closestStationNum = bitscanforward(entranceStations);
entranceStations &= ~(1 << closestStationNum);
select--;
}
closestStationNum = bitscanforward(entranceStations);
closestStationNum = guest_pathfinding_select_random_station(peep, numEntranceStations, entranceStations);
}
if (numEntranceStations == 0)
+2 -2
View File
@@ -2404,7 +2404,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
}
peep->time_lost = 0;
uint8_t stationNum = tile_element->AsEntrance()->GetStationIndex();
auto stationNum = tile_element->AsEntrance()->GetStationIndex();
// Guest walks up to the ride for the first time since entering
// the path tile or since considering another ride attached to
// the path tile.
@@ -2831,7 +2831,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen
{
// Peep is not queuing.
peep->time_lost = 0;
uint8_t stationNum = tile_element->AsPath()->GetStationIndex();
auto stationNum = tile_element->AsPath()->GetStationIndex();
if ((tile_element->AsPath()->HasQueueBanner())
&& (tile_element->AsPath()->GetQueueBannerDirection()
+1 -1
View File
@@ -582,7 +582,7 @@ struct Peep : SpriteBase
uint8_t photo3_ride_ref;
uint8_t photo4_ride_ref;
uint8_t current_ride;
uint8_t current_ride_station;
StationIndex current_ride_station;
uint8_t current_train;
union
{
+1 -1
View File
@@ -2441,7 +2441,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, Ride* ride)
return true;
}
uint8_t stationDirection = 0;
Direction stationDirection = 0;
track_begin_end trackBeginEnd;
while (track_block_get_previous(input.x, input.y, input.element, &trackBeginEnd))
{
+25 -28
View File
@@ -116,7 +116,7 @@ CoordsXYZD _unkF440C5;
uint8_t gRideEntranceExitPlaceType;
ride_id_t gRideEntranceExitPlaceRideIndex;
uint8_t gRideEntranceExitPlaceStationIndex;
StationIndex gRideEntranceExitPlaceStationIndex;
uint8_t gRideEntranceExitPlacePreviousRideConstructionState;
Direction gRideEntranceExitPlaceDirection;
@@ -266,7 +266,7 @@ int32_t Ride::GetMaxQueueTime() const
return (int32_t)queueTime;
}
Peep* Ride::GetQueueHeadGuest(int32_t stationIndex) const
Peep* Ride::GetQueueHeadGuest(StationIndex stationIndex) const
{
Peep* peep;
Peep* result = nullptr;
@@ -279,7 +279,7 @@ Peep* Ride::GetQueueHeadGuest(int32_t stationIndex) const
return result;
}
void Ride::UpdateQueueLength(int32_t stationIndex)
void Ride::UpdateQueueLength(StationIndex stationIndex)
{
uint16_t count = 0;
Peep* peep;
@@ -292,7 +292,7 @@ void Ride::UpdateQueueLength(int32_t stationIndex)
stations[stationIndex].QueueLength = count;
}
void Ride::QueueInsertGuestAtFront(int32_t stationIndex, Peep* peep)
void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Peep* peep)
{
assert(stationIndex < MAX_STATIONS);
assert(peep != nullptr);
@@ -1680,7 +1680,7 @@ static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement)
if (entranceType != ENTRANCE_TYPE_RIDE_ENTRANCE && entranceType != ENTRANCE_TYPE_RIDE_EXIT)
return false;
int32_t stationIndex = entranceElement->GetStationIndex();
auto stationIndex = entranceElement->GetStationIndex();
// Get or create construction window for ride
auto constructionWindow = window_find_by_class(WC_RIDE_CONSTRUCTION);
@@ -2638,7 +2638,7 @@ static void ride_call_closest_mechanic(Ride* ride)
Peep* ride_find_closest_mechanic(Ride* ride, int32_t forInspection)
{
// Get either exit position or entrance position if there is no exit
int32_t stationIndex = ride->inspection_station;
auto stationIndex = ride->inspection_station;
TileCoordsXYZD location = ride_get_exit_location(ride, stationIndex);
if (location.isNull())
{
@@ -3729,14 +3729,14 @@ money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, u
*
* rct2: 0x006B4CC1
*/
static int32_t ride_mode_check_valid_station_numbers(Ride* ride)
static StationIndex ride_mode_check_valid_station_numbers(Ride* ride)
{
uint8_t no_stations = 0;
for (uint8_t station_index = 0; station_index < MAX_STATIONS; ++station_index)
uint16_t numStations = 0;
for (StationIndex stationIndex = 0; stationIndex < MAX_STATIONS; ++stationIndex)
{
if (!ride->stations[station_index].Start.isNull())
if (!ride->stations[stationIndex].Start.isNull())
{
no_stations++;
numStations++;
}
}
@@ -3746,12 +3746,12 @@ static int32_t ride_mode_check_valid_station_numbers(Ride* ride)
case RIDE_MODE_POWERED_LAUNCH_PASSTROUGH:
case RIDE_MODE_POWERED_LAUNCH:
case RIDE_MODE_LIM_POWERED_LAUNCH:
if (no_stations <= 1)
if (numStations <= 1)
return 1;
gGameCommandErrorText = STR_UNABLE_TO_OPERATE_WITH_MORE_THAN_ONE_STATION_IN_THIS_MODE;
return 0;
case RIDE_MODE_SHUTTLE:
if (no_stations >= 2)
if (numStations >= 2)
return 1;
gGameCommandErrorText = STR_UNABLE_TO_OPERATE_WITH_LESS_THAN_TWO_STATIONS_IN_THIS_MODE;
return 0;
@@ -3759,7 +3759,7 @@ static int32_t ride_mode_check_valid_station_numbers(Ride* ride)
if (ride->type == RIDE_TYPE_GO_KARTS || ride->type == RIDE_TYPE_MINI_GOLF)
{
if (no_stations <= 1)
if (numStations <= 1)
return 1;
gGameCommandErrorText = STR_UNABLE_TO_OPERATE_WITH_MORE_THAN_ONE_STATION_IN_THIS_MODE;
return 0;
@@ -4821,8 +4821,7 @@ void loc_6DDF9C(Ride* ride, TileElement* tileElement)
static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying)
{
CoordsXYZ location;
int32_t stationIndex;
for (stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++)
for (StationIndex stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++)
{
location = ride->stations[stationIndex].GetStart();
if (!location.isNull())
@@ -5098,7 +5097,6 @@ static TileElement* loc_6B4F6B(ride_id_t rideIndex, int32_t x, int32_t y)
int32_t ride_is_valid_for_test(Ride* ride, int32_t status, bool isApplying)
{
int32_t stationIndex;
CoordsXYE trackElement, problematicTrackElement = {};
if (ride->type == RIDE_TYPE_NULL)
@@ -5112,8 +5110,8 @@ int32_t ride_is_valid_for_test(Ride* ride, int32_t status, bool isApplying)
window_close_by_number(WC_RIDE_CONSTRUCTION, ride->id);
}
stationIndex = ride_mode_check_station_present(ride);
if (stationIndex == -1)
StationIndex stationIndex = ride_mode_check_station_present(ride);
if (stationIndex == STATION_INDEX_NULL)
return 0;
if (!ride_mode_check_valid_station_numbers(ride))
@@ -5238,7 +5236,6 @@ int32_t ride_is_valid_for_test(Ride* ride, int32_t status, bool isApplying)
*/
int32_t ride_is_valid_for_open(Ride* ride, int32_t goingToBeOpen, bool isApplying)
{
int32_t stationIndex;
CoordsXYE trackElement, problematicTrackElement = {};
// Check to see if construction tool is in use. If it is close the construction window
@@ -5249,8 +5246,8 @@ int32_t ride_is_valid_for_open(Ride* ride, int32_t goingToBeOpen, bool isApplyin
&& (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
window_close_by_number(WC_RIDE_CONSTRUCTION, ride->id);
stationIndex = ride_mode_check_station_present(ride);
if (stationIndex == -1)
StationIndex stationIndex = ride_mode_check_station_present(ride);
if (stationIndex == STATION_INDEX_NULL)
return 0;
if (!ride_mode_check_valid_station_numbers(ride))
@@ -6794,7 +6791,7 @@ void sub_6CB945(Ride* ride)
{
if (ride->type != RIDE_TYPE_MAZE)
{
for (uint8_t stationId = 0; stationId < MAX_STATIONS; ++stationId)
for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId)
{
if (ride->stations[stationId].Start.isNull())
continue;
@@ -6887,7 +6884,7 @@ void sub_6CB945(Ride* ride)
}
std::vector<TileCoordsXYZD> locations;
for (uint8_t stationId = 0; stationId < MAX_STATIONS; ++stationId)
for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId)
{
auto entrance = ride_get_entrance_location(ride, stationId);
if (!entrance.isNull())
@@ -6966,7 +6963,7 @@ void sub_6CB945(Ride* ride)
continue;
}
uint8_t stationId = 0;
StationIndex stationId = 0;
if (trackType != TRACK_ELEM_MAZE)
{
stationId = trackElement->AsTrack()->GetStationIndex();
@@ -7250,13 +7247,13 @@ bool ride_has_adjacent_station(Ride* ride)
/* Loop through all of the ride stations, checking for an
* adjacent station on either side. */
for (int32_t stationNum = 0; stationNum < MAX_STATIONS; stationNum++)
for (StationIndex stationNum = 0; stationNum < MAX_STATIONS; stationNum++)
{
auto stationStart = ride->stations[stationNum].Start;
if (!stationStart.isNull())
{
/* Get the map element for the station start. */
uint8_t stationZ = ride->stations[stationNum].Height;
auto stationZ = ride->stations[stationNum].Height;
TileElement* stationElement = get_station_platform(stationStart.x, stationStart.y, stationZ, 0);
if (stationElement == nullptr)
@@ -7542,7 +7539,7 @@ void determine_ride_entrance_and_exit_locations()
for (auto& ride : GetRideManager())
{
for (int32_t stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++)
for (StationIndex stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++)
{
TileCoordsXYZD entranceLoc = ride.stations[stationIndex].Entrance;
TileCoordsXYZD exitLoc = ride.stations[stationIndex].Exit;
+6 -6
View File
@@ -332,7 +332,7 @@ struct Ride
uint8_t breakdown_reason_pending;
uint8_t mechanic_status;
uint16_t mechanic;
uint8_t inspection_station;
StationIndex inspection_station;
uint8_t broken_vehicle;
uint8_t broken_car;
uint8_t breakdown_reason;
@@ -393,7 +393,7 @@ private:
void Update();
void UpdateChairlift();
void UpdateSpiralSlide();
void UpdateQueueLength(int32_t stationIndex);
void UpdateQueueLength(StationIndex stationIndex);
money32 CalculateIncomePerHour() const;
public:
@@ -434,8 +434,8 @@ public:
int32_t GetTotalQueueLength() const;
int32_t GetMaxQueueTime() const;
void QueueInsertGuestAtFront(int32_t stationIndex, Peep* peep);
Peep* GetQueueHeadGuest(int32_t stationIndex) const;
void QueueInsertGuestAtFront(StationIndex stationIndex, Peep* peep);
Peep* GetQueueHeadGuest(StationIndex stationIndex) const;
void SetNameToDefault();
std::string GetName() const;
@@ -1118,7 +1118,7 @@ extern CoordsXYZD _unkF440C5;
extern uint8_t gRideEntranceExitPlaceType;
extern ride_id_t gRideEntranceExitPlaceRideIndex;
extern uint8_t gRideEntranceExitPlaceStationIndex;
extern StationIndex gRideEntranceExitPlaceStationIndex;
extern uint8_t gRideEntranceExitPlacePreviousRideConstructionState;
extern uint8_t gRideEntranceExitPlaceDirection;
@@ -1215,7 +1215,7 @@ void ride_get_start_of_track(CoordsXYE* output);
void window_ride_construction_update_active_elements();
void ride_construction_remove_ghosts();
money32 ride_entrance_exit_place_ghost(
Ride* ride, const CoordsXY& entranceExitCoords, int32_t direction, int32_t placeType, int32_t stationNum);
Ride* ride, const CoordsXY& entranceExitCoords, Direction direction, int32_t placeType, StationIndex stationNum);
CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenCoordsXY& screenCoords);
bool ride_select_backwards_from_front();
+2 -2
View File
@@ -255,7 +255,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride)
// First entrances, second exits
for (int32_t i = 0; i < 2; i++)
{
for (int32_t station_index = 0; station_index < RCT12_MAX_STATIONS_PER_RIDE; station_index++)
for (StationIndex station_index = 0; station_index < RCT12_MAX_STATIONS_PER_RIDE; station_index++)
{
z = ride.stations[station_index].GetBaseZ();
@@ -1685,7 +1685,7 @@ static bool track_design_place_ride(TrackDesign* td6, int16_t x, int16_t y, int1
continue;
}
int32_t stationIndex = tile_element->AsTrack()->GetStationIndex();
auto stationIndex = tile_element->AsTrack()->GetStationIndex();
uint8_t flags = GAME_COMMAND_FLAG_APPLY;
if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_TRACK_PREVIEW)
{
+6 -6
View File
@@ -2693,7 +2693,7 @@ static void vehicle_update_waiting_to_depart(Vehicle* vehicle)
struct rct_synchronised_vehicle
{
ride_id_t ride_id;
uint8_t station_id;
StationIndex stationIndex;
uint16_t vehicle_id;
};
@@ -2737,11 +2737,11 @@ static bool try_add_synchronised_station(int32_t x, int32_t y, int32_t z)
* to sync with adjacent stations, so it will return true.
* Still to determine if a vehicle to sync can be identified. */
int32_t stationIndex = tileElement->AsTrack()->GetStationIndex();
auto stationIndex = tileElement->AsTrack()->GetStationIndex();
rct_synchronised_vehicle* sv = _lastSynchronisedVehicle;
sv->ride_id = rideIndex;
sv->station_id = stationIndex;
sv->stationIndex = stationIndex;
sv->vehicle_id = SPRITE_INDEX_NULL;
_lastSynchronisedVehicle++;
@@ -2814,7 +2814,7 @@ static bool vehicle_can_depart_synchronised(Vehicle* vehicle)
if (ride == nullptr)
return false;
int32_t station = vehicle->current_station;
StationIndex station = vehicle->current_station;
auto location = ride->stations[station].GetStart();
int32_t x = location.x;
int32_t y = location.y;
@@ -2892,7 +2892,7 @@ static bool vehicle_can_depart_synchronised(Vehicle* vehicle)
{
if (sv_ride->IsBlockSectioned())
{
if (!(sv_ride->stations[sv->station_id].Depart & STATION_DEPART_FLAG))
if (!(sv_ride->stations[sv->stationIndex].Depart & STATION_DEPART_FLAG))
{
sv = _synchronisedVehicles;
uint8_t rideId = RIDE_ID_NULL;
@@ -2947,7 +2947,7 @@ static bool vehicle_can_depart_synchronised(Vehicle* vehicle)
int32_t numTrainsAtStation = 0;
int32_t numTravelingTrains = 0;
int32_t currentStation = sv->station_id;
auto currentStation = sv->stationIndex;
for (int32_t i = 0; i < sv_ride->num_vehicles; i++)
{
uint16_t spriteIndex = sv_ride->vehicles[i];
+2 -1
View File
@@ -15,6 +15,7 @@
#include "../ride/RideTypes.h"
#include "../world/Location.hpp"
#include "../world/SpriteBase.h"
#include "Station.h"
#include <array>
#include <cstddef>
@@ -212,7 +213,7 @@ struct Vehicle : SpriteBase
uint16_t mass;
uint16_t update_flags;
uint8_t swing_sprite;
uint8_t current_station;
StationIndex current_station;
union
{
int16_t swinging_car_var_0;
+4 -4
View File
@@ -33,10 +33,10 @@ CoordsXYZD gParkEntranceGhostPosition = { 0, 0, 0, 0 };
std::vector<CoordsXYZD> gParkEntrances;
CoordsXYZD gRideEntranceExitGhostPosition;
uint8_t gRideEntranceExitGhostStationIndex;
StationIndex gRideEntranceExitGhostStationIndex;
static money32 RideEntranceExitPlaceGhost(
ride_id_t rideIndex, const CoordsXY& entranceExitCoords, uint8_t direction, uint8_t placeType, uint8_t stationNum)
ride_id_t rideIndex, const CoordsXY& entranceExitCoords, Direction direction, uint8_t placeType, StationIndex stationNum)
{
auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction(
entranceExitCoords, direction, rideIndex, stationNum, placeType == ENTRANCE_TYPE_RIDE_EXIT);
@@ -108,7 +108,7 @@ void ride_entrance_exit_remove_ghost()
* rct2: 0x006CA28C
*/
money32 ride_entrance_exit_place_ghost(
Ride* ride, const CoordsXY& entranceExitCoords, int32_t direction, int32_t placeType, int32_t stationNum)
Ride* ride, const CoordsXY& entranceExitCoords, Direction direction, int32_t placeType, StationIndex stationNum)
{
ride_construction_remove_ghosts();
money32 result = RideEntranceExitPlaceGhost(ride->id, entranceExitCoords, direction, placeType, stationNum);
@@ -119,7 +119,7 @@ money32 ride_entrance_exit_place_ghost(
gRideEntranceExitGhostPosition.x = entranceExitCoords.x;
gRideEntranceExitGhostPosition.y = entranceExitCoords.y;
gRideEntranceExitGhostPosition.direction = direction;
gRideEntranceExitGhostStationIndex = stationNum & 0xFF;
gRideEntranceExitGhostStationIndex = stationNum;
}
return result;
}
+1 -1
View File
@@ -43,7 +43,7 @@ constexpr int32_t MaxRideEntranceOrExitHeight = 244 * COORDS_Z_STEP;
extern std::vector<CoordsXYZD> gParkEntrances;
extern CoordsXYZD gRideEntranceExitGhostPosition;
extern uint8_t gRideEntranceExitGhostStationIndex;
extern StationIndex gRideEntranceExitGhostStationIndex;
void park_entrance_remove_ghost();
money32 park_entrance_place_ghost(const CoordsXYZD& entranceLoc);
+1 -1
View File
@@ -1502,7 +1502,7 @@ void PathElement::SetIsBlockedByVehicle(bool isBlocked)
}
}
uint8_t PathElement::GetStationIndex() const
::StationIndex PathElement::GetStationIndex() const
{
return StationIndex;
}
+1 -1
View File
@@ -689,7 +689,7 @@ GameActionResult::Ptr tile_inspector_entrance_make_usable(const CoordsXY& loc, i
if (isExecuting)
{
uint8_t stationIndex = entranceElement->AsEntrance()->GetStationIndex();
auto stationIndex = entranceElement->AsEntrance()->GetStationIndex();
switch (entranceElement->AsEntrance()->GetEntranceType())
{