forked from rosebudai/OpenRCT2-Web
Create find_first_non_null_station_index()
This commit is contained in:
1 parent
0702402af4
commit
f5923dbe99
10 files changed
+82
-107
No files matched your search
@@ -22,6 +22,7 @@
|
||||
#include "localisation/localisation.h"
|
||||
#include "management/finance.h"
|
||||
#include "network/network.h"
|
||||
#include "ride/station.h"
|
||||
#include "util/util.h"
|
||||
#include "world/Climate.h"
|
||||
#include "world/footpath.h"
|
||||
@@ -369,7 +370,7 @@ static void cheat_remove_all_guests()
|
||||
{
|
||||
ride->num_riders = 0;
|
||||
|
||||
for (size_t stationIndex = 0; stationIndex < RCT12_MAX_STATIONS_PER_RIDE; stationIndex++)
|
||||
for (size_t stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++)
|
||||
{
|
||||
ride->queue_length[stationIndex] = 0;
|
||||
ride->last_peep_in_queue[stationIndex] = SPRITE_INDEX_NULL;
|
||||
|
||||
@@ -2832,7 +2832,7 @@ static void peep_go_to_ride_exit(rct_peep* peep, rct_ride* ride, sint16 x, sint1
|
||||
sprite_move(x, y, z, (rct_sprite*)peep);
|
||||
invalidate_sprite_2((rct_sprite*)peep);
|
||||
|
||||
assert(peep->current_ride_station < RCT12_MAX_STATIONS_PER_RIDE);
|
||||
assert(peep->current_ride_station < MAX_STATIONS);
|
||||
x = ride->exits[peep->current_ride_station].x;
|
||||
y = ride->exits[peep->current_ride_station].y;
|
||||
x *= 32;
|
||||
@@ -3136,7 +3136,7 @@ static void peep_update_ride_sub_state_7(rct_peep* peep){
|
||||
vehicle->friction -= peep->var_41;
|
||||
invalidate_sprite_2((rct_sprite*)vehicle);
|
||||
|
||||
if (ride_station >= 4) {
|
||||
if (ride_station >= MAX_STATIONS) {
|
||||
// HACK #5658: Some parks have hacked rides which end up in this state
|
||||
sint32 bestStationIndex = ride_get_first_valid_station_exit(ride);
|
||||
if (bestStationIndex == -1) {
|
||||
@@ -3151,7 +3151,7 @@ static void peep_update_ride_sub_state_7(rct_peep* peep){
|
||||
|
||||
if (!(vehicle_entry->flags_b & VEHICLE_ENTRY_FLAG_B_10)){
|
||||
sint16 x, y, z;
|
||||
assert(peep->current_ride_station < RCT12_MAX_STATIONS_PER_RIDE);
|
||||
assert(peep->current_ride_station < MAX_STATIONS);
|
||||
x = ride->exits[peep->current_ride_station].x;
|
||||
y = ride->exits[peep->current_ride_station].y;
|
||||
z = ride->station_heights[peep->current_ride_station];
|
||||
@@ -10350,7 +10350,7 @@ static sint32 guest_path_finding(rct_peep* peep)
|
||||
sint32 numEntranceStations = 0;
|
||||
uint8 entranceStations = 0;
|
||||
|
||||
for (uint8 stationNum = 0; stationNum < RCT12_MAX_STATIONS_PER_RIDE; ++stationNum){
|
||||
for (uint8 stationNum = 0; stationNum < MAX_STATIONS; ++stationNum){
|
||||
if (ride->entrances[stationNum].xy == RCT_XY8_UNDEFINED) // stationNum has no entrance (so presumably an exit only station).
|
||||
continue;
|
||||
|
||||
|
||||
@@ -1012,19 +1012,6 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
void FixNumPeepsInQueue()
|
||||
{
|
||||
sint32 i;
|
||||
rct_ride *ride;
|
||||
FOR_ALL_RIDES(i, ride)
|
||||
{
|
||||
for (sint32 stationIndex = 0; stationIndex < RCT12_MAX_STATIONS_PER_RIDE; stationIndex++)
|
||||
{
|
||||
ride->queue_length[stationIndex] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ImportRideMeasurements()
|
||||
{
|
||||
for (sint32 i = 0; i < MAX_RIDE_MEASUREMENTS; i++)
|
||||
|
||||
+34
-52
@@ -338,7 +338,7 @@ sint32 ride_get_count()
|
||||
sint32 ride_get_total_queue_length(rct_ride *ride)
|
||||
{
|
||||
sint32 i, queueLength = 0;
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++)
|
||||
for (i = 0; i < MAX_STATIONS; i++)
|
||||
if (ride->entrances[i].xy != RCT_XY8_UNDEFINED)
|
||||
queueLength += ride->queue_length[i];
|
||||
return queueLength;
|
||||
@@ -347,7 +347,7 @@ sint32 ride_get_total_queue_length(rct_ride *ride)
|
||||
sint32 ride_get_max_queue_time(rct_ride *ride)
|
||||
{
|
||||
sint32 i, queueTime = 0;
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++)
|
||||
for (i = 0; i < MAX_STATIONS; i++)
|
||||
if (ride->entrances[i].xy != RCT_XY8_UNDEFINED)
|
||||
queueTime = max(queueTime, ride->queue_time[i]);
|
||||
return queueTime;
|
||||
@@ -1109,7 +1109,7 @@ static void ride_remove_vehicles(rct_ride *ride)
|
||||
ride->vehicles[i] = SPRITE_INDEX_NULL;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++)
|
||||
for (size_t i = 0; i < MAX_STATIONS; i++)
|
||||
ride->train_at_station[i] = 255;
|
||||
}
|
||||
}
|
||||
@@ -1154,13 +1154,7 @@ void ride_remove_peeps(sint32 rideIndex)
|
||||
rct_ride *ride = get_ride(rideIndex);
|
||||
|
||||
// Find first station
|
||||
sint32 stationIndex = -1;
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
if (ride->station_starts[i].xy != RCT_XY8_UNDEFINED) {
|
||||
stationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sint8 stationIndex = ride_get_first_valid_station_start(ride);
|
||||
|
||||
// Get exit position and direction
|
||||
sint32 exitX = 0;
|
||||
@@ -2028,7 +2022,7 @@ static void ride_update(sint32 rideIndex)
|
||||
|
||||
// Update stations
|
||||
if (ride->type != RIDE_TYPE_MAZE)
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++)
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++)
|
||||
ride_update_station(ride, i);
|
||||
|
||||
// Update financial statistics
|
||||
@@ -2194,7 +2188,7 @@ static void ride_spiral_slide_update(rct_ride *ride)
|
||||
|
||||
const uint8 current_rotation = get_current_rotation();
|
||||
// Invalidate something related to station start
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED)
|
||||
continue;
|
||||
|
||||
@@ -2236,8 +2230,6 @@ static uint8 _breakdownProblemProbabilities[] = {
|
||||
*/
|
||||
static void ride_inspection_update(rct_ride *ride)
|
||||
{
|
||||
sint32 i;
|
||||
|
||||
if (gCurrentTicks & 2047)
|
||||
return;
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
@@ -2263,13 +2255,9 @@ static void ride_inspection_update(rct_ride *ride)
|
||||
// Inspect the first station that has an exit
|
||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_DUE_INSPECTION;
|
||||
ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING;
|
||||
ride->inspection_station = 0;
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
if (ride->exits[i].xy != RCT_XY8_UNDEFINED) {
|
||||
ride->inspection_station = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sint8 stationIndex = ride_get_first_valid_station_exit(ride);
|
||||
ride->inspection_station = (stationIndex != -1) ? stationIndex : 0;
|
||||
}
|
||||
|
||||
static sint32 get_age_penalty(rct_ride *ride) {
|
||||
@@ -2450,12 +2438,12 @@ void ride_prepare_breakdown(sint32 rideIndex, sint32 breakdownReason)
|
||||
case BREAKDOWN_SAFETY_CUT_OUT:
|
||||
case BREAKDOWN_CONTROL_FAILURE:
|
||||
// Inspect first station with an exit
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
if (ride->exits[i].xy != RCT_XY8_UNDEFINED) {
|
||||
ride->inspection_station = i;
|
||||
break;
|
||||
}
|
||||
i = ride_get_first_valid_station_exit(ride);
|
||||
if (i != -1)
|
||||
{
|
||||
ride->inspection_station = i;
|
||||
}
|
||||
|
||||
break;
|
||||
case BREAKDOWN_RESTRAINTS_STUCK_CLOSED:
|
||||
case BREAKDOWN_RESTRAINTS_STUCK_OPEN:
|
||||
@@ -2491,10 +2479,10 @@ void ride_prepare_breakdown(sint32 rideIndex, sint32 breakdownReason)
|
||||
case BREAKDOWN_BRAKES_FAILURE:
|
||||
// Original code generates a random number but does not use it
|
||||
// Unsure if this was supposed to choose a random station (or random station with an exit)
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
i = ride_get_first_valid_station_exit(ride);
|
||||
if (i != -1)
|
||||
{
|
||||
ride->inspection_station = i;
|
||||
if (ride->exits[i].xy != RCT_XY8_UNDEFINED)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3259,7 +3247,7 @@ static sint32 ride_entrance_exit_is_reachable(rct_xy8 coordinates, rct_ride* rid
|
||||
|
||||
static void ride_entrance_exit_connected(rct_ride* ride, sint32 ride_idx)
|
||||
{
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; ++i) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; ++i) {
|
||||
rct_xy8 station_start = ride->station_starts[i],
|
||||
entrance = ride->entrances[i],
|
||||
exit = ride->exits[i];
|
||||
@@ -4025,7 +4013,7 @@ void game_command_set_ride_setting(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32
|
||||
static sint32 ride_mode_check_valid_station_numbers(rct_ride *ride)
|
||||
{
|
||||
uint8 no_stations = 0;
|
||||
for (uint8 station_index = 0; station_index < RCT12_MAX_STATIONS_PER_RIDE; ++station_index){
|
||||
for (uint8 station_index = 0; station_index < MAX_STATIONS; ++station_index){
|
||||
if (ride->station_starts[station_index].xy != RCT_XY8_UNDEFINED)
|
||||
{
|
||||
no_stations++;
|
||||
@@ -4060,13 +4048,7 @@ static sint32 ride_mode_check_valid_station_numbers(rct_ride *ride)
|
||||
* -1 on failure.
|
||||
*/
|
||||
static sint32 ride_mode_check_station_present(rct_ride* ride){
|
||||
sint32 stationIndex = -1;
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
if (ride->station_starts[i].xy != RCT_XY8_UNDEFINED) {
|
||||
stationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sint32 stationIndex = ride_get_first_valid_station_start(ride);
|
||||
|
||||
if (stationIndex == -1) {
|
||||
gGameCommandErrorText = STR_NOT_YET_CONSTRUCTED;
|
||||
@@ -4097,7 +4079,7 @@ static sint32 ride_check_for_entrance_exit(sint32 rideIndex)
|
||||
sint32 i;
|
||||
uint8 entrance = 0;
|
||||
uint8 exit = 0;
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED)
|
||||
continue;
|
||||
|
||||
@@ -4138,7 +4120,7 @@ static void sub_6B5952(sint32 rideIndex)
|
||||
{
|
||||
rct_ride *ride = get_ride(rideIndex);
|
||||
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
rct_xy8 location = ride->entrances[i];
|
||||
if (location.xy == RCT_XY8_UNDEFINED)
|
||||
continue;
|
||||
@@ -4403,7 +4385,7 @@ static void ride_set_maze_entrance_exit_points(rct_ride *ride)
|
||||
|
||||
// Create a list of all the entrance and exit positions
|
||||
uint16 *position = positions;
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->entrances[i].xy != RCT_XY8_UNDEFINED) {
|
||||
*position++ = ride->entrances[i].xy;
|
||||
}
|
||||
@@ -4879,7 +4861,7 @@ static bool ride_create_vehicles(rct_ride *ride, sint32 rideIndex, rct_xy_elemen
|
||||
// Initialise station departs
|
||||
// 006DDDD0:
|
||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_ON_TRACK;
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
ride->station_depart[i] = (ride->station_depart[i] & 0x80) | 1;
|
||||
}
|
||||
|
||||
@@ -4969,7 +4951,7 @@ static bool ride_initialise_cable_lift_track(rct_ride *ride, bool isApplying)
|
||||
{
|
||||
rct_xy8 location;
|
||||
sint32 stationIndex;
|
||||
for (stationIndex = 0; stationIndex < RCT12_MAX_STATIONS_PER_RIDE; stationIndex++) {
|
||||
for (stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++) {
|
||||
location = ride->station_starts[stationIndex];
|
||||
if (location.xy != RCT_XY8_UNDEFINED) break;
|
||||
if (stationIndex == 3) {
|
||||
@@ -5149,7 +5131,7 @@ static void loc_6B51C0(sint32 rideIndex)
|
||||
|
||||
sint8 entranceOrExit = -1;
|
||||
sint32 i;
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED)
|
||||
continue;
|
||||
|
||||
@@ -5910,7 +5892,7 @@ static void ride_set_colour_preset(rct_ride *ride, uint8 index)
|
||||
if (index < colourPresets->count) {
|
||||
colours = colourPresets->list[index];
|
||||
}
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
ride->track_colour_main[i] = colours.main;
|
||||
ride->track_colour_additional[i] = colours.additional;
|
||||
ride->track_colour_supports[i] = colours.supports;
|
||||
@@ -6079,7 +6061,7 @@ foundRideEntry:
|
||||
ride_set_name_to_default(ride, rideEntry);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (size_t i = 0; i < MAX_STATIONS; i++) {
|
||||
ride->station_starts[i].xy = RCT_XY8_UNDEFINED;
|
||||
ride->entrances[i].xy = RCT_XY8_UNDEFINED;
|
||||
ride->exits[i].xy = RCT_XY8_UNDEFINED;
|
||||
@@ -7278,7 +7260,7 @@ void ride_get_entrance_or_exit_position_from_screen_position(sint32 screenX, sin
|
||||
direction = mapX < 0 ? 0 : 2;
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
mapX = _unkF44188.x + TileDirectionDelta[direction].x;
|
||||
mapY = _unkF44188.y + TileDirectionDelta[direction].y;
|
||||
if (mapX >= 0 && mapY >= 0 && mapX < (256 * 32) && mapY < (256 * 32)) {
|
||||
@@ -7432,7 +7414,7 @@ bool ride_are_all_possible_entrances_and_exits_built(rct_ride *ride)
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
return true;
|
||||
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED)
|
||||
{
|
||||
continue;
|
||||
@@ -7615,7 +7597,7 @@ uint64 ride_entry_get_supported_track_pieces(rct_ride_entry* rideEntry)
|
||||
static sint32 ride_get_smallest_station_length(rct_ride *ride)
|
||||
{
|
||||
uint32 result = -1;
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy != RCT_XY8_UNDEFINED) {
|
||||
result = min(result, (uint32)(ride->station_length[i]));
|
||||
}
|
||||
@@ -7634,7 +7616,7 @@ static sint32 ride_get_track_length(rct_ride *ride)
|
||||
track_circuit_iterator it;
|
||||
sint32 x, y, z, trackType, rideIndex, result;
|
||||
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
rct_xy8 location = ride->station_starts[i];
|
||||
if (location.xy == RCT_XY8_UNDEFINED)
|
||||
continue;
|
||||
@@ -8025,7 +8007,7 @@ void sub_6CB945(sint32 rideIndex)
|
||||
{
|
||||
rct_ride* ride = get_ride(rideIndex);
|
||||
if (ride->type != RIDE_TYPE_MAZE) {
|
||||
for (uint8 stationId = 0; stationId < RCT12_MAX_STATIONS_PER_RIDE; ++stationId) {
|
||||
for (uint8 stationId = 0; stationId < MAX_STATIONS; ++stationId) {
|
||||
if (ride->station_starts[stationId].xy == RCT_XY8_UNDEFINED)
|
||||
continue;
|
||||
|
||||
@@ -8105,7 +8087,7 @@ void sub_6CB945(sint32 rideIndex)
|
||||
|
||||
uint16 locations[9];
|
||||
uint16 *locationList = locations;
|
||||
for (uint8 stationId = 0; stationId < RCT12_MAX_STATIONS_PER_RIDE; ++stationId) {
|
||||
for (uint8 stationId = 0; stationId < MAX_STATIONS; ++stationId) {
|
||||
if (ride->entrances[stationId].xy != RCT_XY8_UNDEFINED) {
|
||||
*locationList++ = ride->entrances[stationId].xy;
|
||||
ride->entrances[stationId].xy = RCT_XY8_UNDEFINED;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "ride.h"
|
||||
#include "ride_data.h"
|
||||
#include "ride_ratings.h"
|
||||
#include "station.h"
|
||||
#include "track.h"
|
||||
|
||||
enum {
|
||||
@@ -339,7 +340,7 @@ static void ride_ratings_begin_proximity_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy != RCT_XY8_UNDEFINED) {
|
||||
gRideRatingsCalcData.station_flags &= ~RIDE_RATING_STATION_FLAG_NO_ENTRANCE;
|
||||
if (ride->entrances[i].xy == RCT_XY8_UNDEFINED) {
|
||||
@@ -1246,18 +1247,22 @@ static rating_tuple ride_ratings_get_drop_ratings(rct_ride *ride)
|
||||
*/
|
||||
static sint32 ride_ratings_get_scenery_score(rct_ride *ride)
|
||||
{
|
||||
sint32 i;
|
||||
sint8 i = ride_get_first_valid_station_start(ride);
|
||||
rct_xy8 location;
|
||||
for (i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
location = ride->station_starts[i];
|
||||
if (location.xy != RCT_XY8_UNDEFINED)
|
||||
break;
|
||||
}
|
||||
if (i == 4)
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ride->type == RIDE_TYPE_MAZE)
|
||||
{
|
||||
location = ride->entrances[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
location = ride->station_starts[i];
|
||||
}
|
||||
|
||||
sint32 x = location.x;
|
||||
sint32 y = location.y;
|
||||
@@ -1265,7 +1270,9 @@ static sint32 ride_ratings_get_scenery_score(rct_ride *ride)
|
||||
|
||||
// Check if station is underground, returns a fixed mediocre score since you can't have scenery underground
|
||||
if (z > ride->station_heights[i] * 8)
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
|
||||
// Count surrounding scenery items
|
||||
sint32 numSceneryItems = 0;
|
||||
|
||||
@@ -334,3 +334,15 @@ sint32 ride_get_first_valid_station_exit(rct_ride * ride)
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
sint8 ride_get_first_valid_station_start(const rct_ride *ride)
|
||||
{
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++)
|
||||
{
|
||||
if (ride->station_starts[i].xy != RCT_XY8_UNDEFINED)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -25,5 +25,7 @@
|
||||
|
||||
void ride_update_station(rct_ride *ride, sint32 stationIndex);
|
||||
sint32 ride_get_first_valid_station_exit(rct_ride * ride);
|
||||
sint8 ride_get_first_valid_station_start(const rct_ride *ride);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -646,15 +646,9 @@ static bool track_add_station_element(sint32 x, sint32 y, sint32 z, sint32 direc
|
||||
gGameCommandErrorText = STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE;
|
||||
return false;
|
||||
}
|
||||
if (flags & GAME_COMMAND_FLAG_APPLY) {
|
||||
sint32 stationIndex = -1;
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED) {
|
||||
stationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & GAME_COMMAND_FLAG_APPLY)
|
||||
{
|
||||
sint8 stationIndex = ride_get_first_valid_station_start(ride);
|
||||
assert(stationIndex != -1);
|
||||
|
||||
ride->station_starts[stationIndex].x = (x >> 5);
|
||||
@@ -732,15 +726,9 @@ static bool track_add_station_element(sint32 x, sint32 y, sint32 z, sint32 direc
|
||||
stationElement = find_station_element(x, y, z, direction, rideIndex);
|
||||
if (stationElement != NULL) {
|
||||
sint32 targetTrackType;
|
||||
if (x == stationX1 && y == stationY1) {
|
||||
sint32 stationIndex = -1;
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED) {
|
||||
stationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (x == stationX1 && y == stationY1)
|
||||
{
|
||||
sint8 stationIndex = ride_get_first_valid_station_start(ride);
|
||||
assert(stationIndex != -1);
|
||||
|
||||
ride->station_starts[stationIndex].x = (x >> 5);
|
||||
@@ -860,16 +848,10 @@ static bool track_remove_station_element(sint32 x, sint32 y, sint32 z, sint32 di
|
||||
stationElement = find_station_element(x, y, z, direction, rideIndex);
|
||||
if (stationElement != NULL) {
|
||||
sint32 targetTrackType;
|
||||
if (x == stationX1 && y == stationY1) {
|
||||
if (x == stationX1 && y == stationY1)
|
||||
{
|
||||
loc_6C4BF5:;
|
||||
sint32 stationIndex = -1;
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED) {
|
||||
stationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sint8 stationIndex = ride_get_first_valid_station_start(ride);
|
||||
assert(stationIndex != -1);
|
||||
|
||||
ride->station_starts[stationIndex].x = (x >> 5);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "cable_lift.h"
|
||||
#include "ride.h"
|
||||
#include "ride_data.h"
|
||||
#include "station.h"
|
||||
#include "track.h"
|
||||
#include "track.h"
|
||||
#include "track_data.h"
|
||||
@@ -8501,7 +8502,7 @@ loc_6DCE68:
|
||||
regs.al = vehicle->track_x >> 5;
|
||||
regs.ah = vehicle->track_y >> 5;
|
||||
regs.dl = vehicle->track_z >> 3;
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if ((uint16)regs.ax != ride->station_starts[i].xy) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "../network/network.h"
|
||||
#include "../object_list.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/station.h"
|
||||
#include "../ride/track.h"
|
||||
#include "../ride/track_data.h"
|
||||
#include "../util/util.h"
|
||||
@@ -1500,7 +1501,7 @@ void footpath_update_queue_chains()
|
||||
continue;
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) {
|
||||
for (sint32 i = 0; i < MAX_STATIONS; i++) {
|
||||
if (ride->entrances[i].xy == RCT_XY8_UNDEFINED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user