forked from rosebudai/OpenRCT2-Web
Rename members of Vehicle::Status
This commit is contained in:
10 files changed
+235
-235
No files matched your search
@@ -542,48 +542,48 @@ namespace OpenRCT2::Ui::Windows
|
||||
static_assert(std::size(VehicleColourSchemeNames) == kNumVehicleColourSettings);
|
||||
|
||||
static constexpr std::array VehicleStatusNames = {
|
||||
STR_MOVING_TO_END_OF, // Vehicle::Status::MovingToEndOfStation
|
||||
STR_WAITING_FOR_PASSENGERS_AT, // Vehicle::Status::WaitingForPassengers
|
||||
STR_WAITING_TO_DEPART, // Vehicle::Status::WaitingToDepart
|
||||
STR_DEPARTING, // Vehicle::Status::Departing
|
||||
STR_TRAVELLING_AT_0, // Vehicle::Status::Travelling
|
||||
STR_ARRIVING_AT, // Vehicle::Status::Arriving
|
||||
STR_UNLOADING_PASSENGERS_AT, // Vehicle::Status::UnloadingPassengers
|
||||
STR_TRAVELLING_AT_1, // Vehicle::Status::TravellingBoat
|
||||
STR_CRASHING, // Vehicle::Status::Crashing
|
||||
STR_CRASHED_0, // Vehicle::Status::Crashed
|
||||
STR_TRAVELLING_AT_2, // Vehicle::Status::TravellingDodgems
|
||||
STR_SWINGING, // Vehicle::Status::Swinging
|
||||
STR_ROTATING_0, // Vehicle::Status::Rotating
|
||||
STR_ROTATING_1, // Vehicle::Status::FerrisWheelRotating
|
||||
STR_OPERATING_0, // Vehicle::Status::SimulatorOperating
|
||||
STR_SHOWING_FILM, // Vehicle::Status::ShowingFilm
|
||||
STR_ROTATING_2, // Vehicle::Status::SpaceRingsOperating
|
||||
STR_OPERATING_1, // Vehicle::Status::TopSpinOperating
|
||||
STR_OPERATING_2, // Vehicle::Status::HauntedHouseOperating
|
||||
STR_DOING_CIRCUS_SHOW, // Vehicle::Status::DoingCircusShow
|
||||
STR_OPERATING_3, // Vehicle::Status::CrookedHouseOperating
|
||||
STR_WAITING_FOR_CABLE_LIFT, // Vehicle::Status::WaitingForCableLift
|
||||
STR_TRAVELLING_AT_3, // Vehicle::Status::TravellingCableLift
|
||||
STR_STOPPING_0, // Vehicle::Status::Stopping
|
||||
STR_WAITING_FOR_PASSENGERS, // Vehicle::Status::WaitingForPassengers17
|
||||
STR_WAITING_TO_START, // Vehicle::Status::WaitingToStart
|
||||
STR_STARTING, // Vehicle::Status::Starting
|
||||
STR_OPERATING, // Vehicle::Status::Operating1A
|
||||
STR_STOPPING_1, // Vehicle::Status::Stopping1B
|
||||
STR_UNLOADING_PASSENGERS, // Vehicle::Status::UnloadingPassengers1C
|
||||
STR_STOPPED_BY_BLOCK_BRAKES, // Vehicle::Status::StoppedByBlockBrakes
|
||||
STR_MOVING_TO_END_OF, // Vehicle::Status::movingToEndOfStation
|
||||
STR_WAITING_FOR_PASSENGERS_AT, // Vehicle::Status::waitingForPassengers
|
||||
STR_WAITING_TO_DEPART, // Vehicle::Status::waitingToDepart
|
||||
STR_DEPARTING, // Vehicle::Status::departing
|
||||
STR_TRAVELLING_AT_0, // Vehicle::Status::travelling
|
||||
STR_ARRIVING_AT, // Vehicle::Status::arriving
|
||||
STR_UNLOADING_PASSENGERS_AT, // Vehicle::Status::unloadingPassengers
|
||||
STR_TRAVELLING_AT_1, // Vehicle::Status::travellingBoat
|
||||
STR_CRASHING, // Vehicle::Status::crashing
|
||||
STR_CRASHED_0, // Vehicle::Status::crashed
|
||||
STR_TRAVELLING_AT_2, // Vehicle::Status::travellingDodgems
|
||||
STR_SWINGING, // Vehicle::Status::swinging
|
||||
STR_ROTATING_0, // Vehicle::Status::rotating
|
||||
STR_ROTATING_1, // Vehicle::Status::ferrisWheelRotating
|
||||
STR_OPERATING_0, // Vehicle::Status::simulatorOperating
|
||||
STR_SHOWING_FILM, // Vehicle::Status::showingFilm
|
||||
STR_ROTATING_2, // Vehicle::Status::spaceRingsOperating
|
||||
STR_OPERATING_1, // Vehicle::Status::topSpinOperating
|
||||
STR_OPERATING_2, // Vehicle::Status::hauntedHouseOperating
|
||||
STR_DOING_CIRCUS_SHOW, // Vehicle::Status::doingCircusShow
|
||||
STR_OPERATING_3, // Vehicle::Status::crookedHouseOperating
|
||||
STR_WAITING_FOR_CABLE_LIFT, // Vehicle::Status::waitingForCableLift
|
||||
STR_TRAVELLING_AT_3, // Vehicle::Status::travellingCableLift
|
||||
STR_STOPPING_0, // Vehicle::Status::stopping
|
||||
STR_WAITING_FOR_PASSENGERS, // Vehicle::Status::waitingForPassengers17
|
||||
STR_WAITING_TO_START, // Vehicle::Status::waitingToStart
|
||||
STR_STARTING, // Vehicle::Status::starting
|
||||
STR_OPERATING, // Vehicle::Status::operating1A
|
||||
STR_STOPPING_1, // Vehicle::Status::stopping1B
|
||||
STR_UNLOADING_PASSENGERS, // Vehicle::Status::unloadingPassengers1C
|
||||
STR_STOPPED_BY_BLOCK_BRAKES, // Vehicle::Status::stoppedByBlockBrakes
|
||||
};
|
||||
static_assert(std::size(VehicleStatusNames) == 31);
|
||||
|
||||
static constexpr std::array SingleSessionVehicleStatusNames = {
|
||||
STR_STOPPING_0, // Vehicle::Status::MovingToEndOfStation
|
||||
STR_WAITING_FOR_PASSENGERS, // Vehicle::Status::WaitingForPassengers
|
||||
STR_WAITING_TO_START, // Vehicle::Status::WaitingToDepart
|
||||
STR_STARTING, // Vehicle::Status::Departing
|
||||
STR_OPERATING, // Vehicle::Status::Travelling
|
||||
STR_STOPPING_1, // Vehicle::Status::Arriving
|
||||
STR_UNLOADING_PASSENGERS, // Vehicle::Status::UnloadingPassengers
|
||||
STR_STOPPING_0, // Vehicle::Status::movingToEndOfStation
|
||||
STR_WAITING_FOR_PASSENGERS, // Vehicle::Status::waitingForPassengers
|
||||
STR_WAITING_TO_START, // Vehicle::Status::waitingToDepart
|
||||
STR_STARTING, // Vehicle::Status::departing
|
||||
STR_OPERATING, // Vehicle::Status::travelling
|
||||
STR_STOPPING_1, // Vehicle::Status::arriving
|
||||
STR_UNLOADING_PASSENGERS, // Vehicle::Status::unloadingPassengers
|
||||
};
|
||||
static_assert(std::size(SingleSessionVehicleStatusNames) == 7);
|
||||
|
||||
@@ -2262,10 +2262,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride->vehicles[_viewIndex - 1]);
|
||||
if (vehicle == nullptr
|
||||
|| (vehicle->status != Vehicle::Status::Travelling
|
||||
&& vehicle->status != Vehicle::Status::TravellingCableLift
|
||||
&& vehicle->status != Vehicle::Status::TravellingDodgems
|
||||
&& vehicle->status != Vehicle::Status::TravellingBoat))
|
||||
|| (vehicle->status != Vehicle::Status::travelling
|
||||
&& vehicle->status != Vehicle::Status::travellingCableLift
|
||||
&& vehicle->status != Vehicle::Status::travellingDodgems
|
||||
&& vehicle->status != Vehicle::Status::travellingBoat))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2459,7 +2459,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return kStringIdEmpty;
|
||||
|
||||
auto& rtd = ride->getRideTypeDescriptor();
|
||||
if (vehicle->status != Vehicle::Status::Crashing && vehicle->status != Vehicle::Status::Crashed)
|
||||
if (vehicle->status != Vehicle::Status::crashing && vehicle->status != Vehicle::Status::crashed)
|
||||
{
|
||||
auto trackType = vehicle->GetTrackType();
|
||||
if (trackType == TrackElemType::BlockBrakes || trackType == TrackElemType::CableLiftHill
|
||||
@@ -2480,7 +2480,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto stringId = VehicleStatusNames[EnumValue(vehicle->status)];
|
||||
if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::singleSession)
|
||||
&& vehicle->status <= Vehicle::Status::UnloadingPassengers)
|
||||
&& vehicle->status <= Vehicle::Status::unloadingPassengers)
|
||||
{
|
||||
stringId = SingleSessionVehicleStatusNames[EnumValue(vehicle->status)];
|
||||
}
|
||||
|
||||
@@ -2595,7 +2595,7 @@ static bool FindVehicleToEnter(
|
||||
if (vehicle->next_free_seat >= vehicle->num_seats)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::WaitingForPassengers)
|
||||
if (vehicle->status != Vehicle::Status::waitingForPassengers)
|
||||
continue;
|
||||
chosen_train = i;
|
||||
break;
|
||||
|
||||
@@ -2876,8 +2876,8 @@ namespace OpenRCT2::RCT1
|
||||
}
|
||||
}
|
||||
|
||||
::Vehicle::Status statusSrc = ::Vehicle::Status::MovingToEndOfStation;
|
||||
if (src->Status <= static_cast<uint8_t>(::Vehicle::Status::StoppedByBlockBrakes))
|
||||
::Vehicle::Status statusSrc = ::Vehicle::Status::movingToEndOfStation;
|
||||
if (src->Status <= static_cast<uint8_t>(::Vehicle::Status::stoppedByBlockBrakes))
|
||||
{
|
||||
statusSrc = static_cast<::Vehicle::Status>(src->Status);
|
||||
}
|
||||
@@ -2885,7 +2885,7 @@ namespace OpenRCT2::RCT1
|
||||
dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition };
|
||||
dst->TrackLocation = { src->TrackX, src->TrackY, src->TrackZ };
|
||||
dst->current_station = StationIndex::FromUnderlying(src->CurrentStation);
|
||||
if (src->BoatLocation.IsNull() || ride->mode != RideMode::boatHire || statusSrc != ::Vehicle::Status::TravellingBoat)
|
||||
if (src->BoatLocation.IsNull() || ride->mode != RideMode::boatHire || statusSrc != ::Vehicle::Status::travellingBoat)
|
||||
{
|
||||
dst->BoatLocation.SetNull();
|
||||
dst->SetTrackDirection(src->GetTrackDirection());
|
||||
|
||||
@@ -1965,7 +1965,7 @@ namespace OpenRCT2::RCT2
|
||||
dst->track_progress = src->TrackProgress;
|
||||
dst->TrackLocation = { src->TrackX, src->TrackY, src->TrackZ };
|
||||
if (src->BoatLocation.IsNull() || static_cast<RideMode>(ride.mode) != RideMode::boatHire
|
||||
|| src->Status != static_cast<uint8_t>(::Vehicle::Status::TravellingBoat))
|
||||
|| src->Status != static_cast<uint8_t>(::Vehicle::Status::travellingBoat))
|
||||
{
|
||||
dst->BoatLocation.SetNull();
|
||||
dst->SetTrackDirection(src->GetTrackDirection());
|
||||
@@ -2010,8 +2010,8 @@ namespace OpenRCT2::RCT2
|
||||
dst->current_time = src->CurrentTime;
|
||||
dst->crash_z = src->CrashZ;
|
||||
|
||||
::Vehicle::Status statusSrc = ::Vehicle::Status::MovingToEndOfStation;
|
||||
if (src->Status <= static_cast<uint8_t>(::Vehicle::Status::StoppedByBlockBrakes))
|
||||
::Vehicle::Status statusSrc = ::Vehicle::Status::movingToEndOfStation;
|
||||
if (src->Status <= static_cast<uint8_t>(::Vehicle::Status::stoppedByBlockBrakes))
|
||||
{
|
||||
statusSrc = static_cast<::Vehicle::Status>(src->Status);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ Vehicle* CableLiftSegmentCreate(
|
||||
current->SetTrackDirection(current->Orientation >> 3);
|
||||
current->track_progress = 164;
|
||||
current->Flags = VehicleFlags::CollisionDisabled;
|
||||
current->SetState(Vehicle::Status::MovingToEndOfStation, 0);
|
||||
current->SetState(Vehicle::Status::movingToEndOfStation, 0);
|
||||
current->num_peeps = 0;
|
||||
current->next_free_seat = 0;
|
||||
current->BoatLocation.SetNull();
|
||||
@@ -90,22 +90,22 @@ void Vehicle::CableLiftUpdate()
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case Vehicle::Status::MovingToEndOfStation:
|
||||
case Vehicle::Status::movingToEndOfStation:
|
||||
CableLiftUpdateMovingToEndOfStation();
|
||||
break;
|
||||
case Vehicle::Status::WaitingForPassengers:
|
||||
case Vehicle::Status::waitingForPassengers:
|
||||
// Stays in this state until a train puts it into next state
|
||||
break;
|
||||
case Vehicle::Status::WaitingToDepart:
|
||||
case Vehicle::Status::waitingToDepart:
|
||||
CableLiftUpdateWaitingToDepart();
|
||||
break;
|
||||
case Vehicle::Status::Departing:
|
||||
case Vehicle::Status::departing:
|
||||
CableLiftUpdateDeparting();
|
||||
break;
|
||||
case Vehicle::Status::Travelling:
|
||||
case Vehicle::Status::travelling:
|
||||
CableLiftUpdateTravelling();
|
||||
break;
|
||||
case Vehicle::Status::Arriving:
|
||||
case Vehicle::Status::arriving:
|
||||
CableLiftUpdateArriving();
|
||||
break;
|
||||
default:
|
||||
@@ -135,7 +135,7 @@ void Vehicle::CableLiftUpdateMovingToEndOfStation()
|
||||
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::WaitingForPassengers, sub_state);
|
||||
SetState(Vehicle::Status::waitingForPassengers, sub_state);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +175,7 @@ void Vehicle::CableLiftUpdateWaitingToDepart()
|
||||
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::Departing, 0);
|
||||
SetState(Vehicle::Status::departing, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,8 +193,8 @@ void Vehicle::CableLiftUpdateDeparting()
|
||||
{
|
||||
return;
|
||||
}
|
||||
SetState(Vehicle::Status::Travelling, sub_state);
|
||||
passengerVehicle->SetState(Vehicle::Status::TravellingCableLift, passengerVehicle->sub_state);
|
||||
SetState(Vehicle::Status::travelling, sub_state);
|
||||
passengerVehicle->SetState(Vehicle::Status::travellingCableLift, passengerVehicle->sub_state);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,7 +219,7 @@ void Vehicle::CableLiftUpdateTravelling()
|
||||
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::Arriving, 0);
|
||||
SetState(Vehicle::Status::arriving, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,7 +230,7 @@ void Vehicle::CableLiftUpdateArriving()
|
||||
{
|
||||
sub_state++;
|
||||
if (sub_state >= 64)
|
||||
SetState(Vehicle::Status::MovingToEndOfStation, sub_state);
|
||||
SetState(Vehicle::Status::movingToEndOfStation, sub_state);
|
||||
}
|
||||
|
||||
bool Vehicle::CableLiftUpdateTrackMotionForwards()
|
||||
|
||||
@@ -1944,7 +1944,7 @@ static bool RideMusicBreakdownEffect(Ride& ride)
|
||||
void CircusMusicUpdate(Ride& ride)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[0]);
|
||||
if (vehicle == nullptr || vehicle->status != Vehicle::Status::DoingCircusShow)
|
||||
if (vehicle == nullptr || vehicle->status != Vehicle::Status::doingCircusShow)
|
||||
{
|
||||
ride.musicPosition = 0;
|
||||
ride.musicTuneId = kTuneIDNull;
|
||||
@@ -2029,7 +2029,7 @@ static void RideMeasurementUpdate(Ride& ride, RideMeasurement& measurement)
|
||||
|
||||
if (measurement.flags & RIDE_MEASUREMENT_FLAG_UNLOADING)
|
||||
{
|
||||
if (vehicle->status != Vehicle::Status::Departing && vehicle->status != Vehicle::Status::TravellingCableLift)
|
||||
if (vehicle->status != Vehicle::Status::departing && vehicle->status != Vehicle::Status::travellingCableLift)
|
||||
return;
|
||||
|
||||
measurement.flags &= ~RIDE_MEASUREMENT_FLAG_UNLOADING;
|
||||
@@ -2037,7 +2037,7 @@ static void RideMeasurementUpdate(Ride& ride, RideMeasurement& measurement)
|
||||
measurement.current_item = 0;
|
||||
}
|
||||
|
||||
if (vehicle->status == Vehicle::Status::UnloadingPassengers)
|
||||
if (vehicle->status == Vehicle::Status::unloadingPassengers)
|
||||
{
|
||||
measurement.flags |= RIDE_MEASUREMENT_FLAG_UNLOADING;
|
||||
return;
|
||||
@@ -2123,8 +2123,8 @@ void RideMeasurementsUpdate()
|
||||
auto vehicle = gameState.entities.GetEntity<Vehicle>(vehicleSpriteIdx);
|
||||
if (vehicle != nullptr)
|
||||
{
|
||||
if (vehicle->status == Vehicle::Status::Departing
|
||||
|| vehicle->status == Vehicle::Status::TravellingCableLift)
|
||||
if (vehicle->status == Vehicle::Status::departing
|
||||
|| vehicle->status == Vehicle::Status::travellingCableLift)
|
||||
{
|
||||
measurement->vehicle_index = j;
|
||||
measurement->current_station = vehicle->current_station;
|
||||
@@ -3333,7 +3333,7 @@ static Vehicle* VehicleCreateCar(
|
||||
vehicle->SetTrackDirection(0);
|
||||
vehicle->SetTrackType(trackElement->GetTrackType());
|
||||
vehicle->track_progress = 0;
|
||||
vehicle->SetState(Vehicle::Status::MovingToEndOfStation);
|
||||
vehicle->SetState(Vehicle::Status::movingToEndOfStation);
|
||||
vehicle->Flags = 0;
|
||||
|
||||
CoordsXY chosenLoc;
|
||||
@@ -3441,7 +3441,7 @@ static Vehicle* VehicleCreateCar(
|
||||
vehicle->SetFlag(VehicleFlags::CarIsInverted);
|
||||
}
|
||||
}
|
||||
vehicle->SetState(Vehicle::Status::MovingToEndOfStation);
|
||||
vehicle->SetState(Vehicle::Status::movingToEndOfStation);
|
||||
|
||||
if (ride.hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS))
|
||||
{
|
||||
@@ -3790,10 +3790,10 @@ void Ride::moveTrainsToBlockBrakes(const CoordsXYZ& firstBlockPosition, TrackEle
|
||||
for (Vehicle* car = train; car != nullptr; car = getGameState().entities.GetEntity<Vehicle>(car->next_vehicle_on_train))
|
||||
{
|
||||
car->ClearFlag(VehicleFlags::CollisionDisabled);
|
||||
car->SetState(Vehicle::Status::Travelling, car->sub_state);
|
||||
car->SetState(Vehicle::Status::travelling, car->sub_state);
|
||||
if ((car->GetTrackType()) == TrackElemType::EndStation)
|
||||
{
|
||||
car->SetState(Vehicle::Status::MovingToEndOfStation, car->sub_state);
|
||||
car->SetState(Vehicle::Status::movingToEndOfStation, car->sub_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex)
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::WaitingToDepart)
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
return;
|
||||
@@ -212,7 +212,7 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex)
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::WaitingToDepart && vehicle->NumLaps >= numLaps)
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart && vehicle->NumLaps >= numLaps)
|
||||
{
|
||||
// Found a winner
|
||||
if (vehicle->num_peeps != 0)
|
||||
@@ -248,7 +248,7 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex)
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::WaitingToDepart && vehicle->status != Vehicle::Status::Departing)
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart && vehicle->status != Vehicle::Status::departing)
|
||||
{
|
||||
if (station.Depart & kStationDepartFlag)
|
||||
{
|
||||
|
||||
@@ -533,7 +533,7 @@ void Vehicle::UpdateMeasurements()
|
||||
if (curRide == nullptr)
|
||||
return;
|
||||
|
||||
if (status == Vehicle::Status::TravellingBoat)
|
||||
if (status == Vehicle::Status::travellingBoat)
|
||||
{
|
||||
curRide->lifecycleFlags |= RIDE_LIFECYCLE_TESTED;
|
||||
curRide->lifecycleFlags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
||||
@@ -971,71 +971,71 @@ void Vehicle::Update()
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case Vehicle::Status::MovingToEndOfStation:
|
||||
case Vehicle::Status::movingToEndOfStation:
|
||||
UpdateMovingToEndOfStation();
|
||||
break;
|
||||
case Vehicle::Status::WaitingForPassengers:
|
||||
case Vehicle::Status::waitingForPassengers:
|
||||
UpdateWaitingForPassengers();
|
||||
break;
|
||||
case Vehicle::Status::WaitingToDepart:
|
||||
case Vehicle::Status::waitingToDepart:
|
||||
UpdateWaitingToDepart();
|
||||
break;
|
||||
case Vehicle::Status::Crashing:
|
||||
case Vehicle::Status::Crashed:
|
||||
case Vehicle::Status::crashing:
|
||||
case Vehicle::Status::crashed:
|
||||
UpdateCrash();
|
||||
break;
|
||||
case Vehicle::Status::TravellingDodgems:
|
||||
case Vehicle::Status::travellingDodgems:
|
||||
UpdateDodgemsMode();
|
||||
break;
|
||||
case Vehicle::Status::Swinging:
|
||||
case Vehicle::Status::swinging:
|
||||
UpdateSwinging();
|
||||
break;
|
||||
case Vehicle::Status::SimulatorOperating:
|
||||
case Vehicle::Status::simulatorOperating:
|
||||
UpdateSimulatorOperating();
|
||||
break;
|
||||
case Vehicle::Status::TopSpinOperating:
|
||||
case Vehicle::Status::topSpinOperating:
|
||||
UpdateTopSpinOperating();
|
||||
break;
|
||||
case Vehicle::Status::FerrisWheelRotating:
|
||||
case Vehicle::Status::ferrisWheelRotating:
|
||||
UpdateFerrisWheelRotating();
|
||||
break;
|
||||
case Vehicle::Status::SpaceRingsOperating:
|
||||
case Vehicle::Status::spaceRingsOperating:
|
||||
UpdateSpaceRingsOperating();
|
||||
break;
|
||||
case Vehicle::Status::HauntedHouseOperating:
|
||||
case Vehicle::Status::hauntedHouseOperating:
|
||||
UpdateHauntedHouseOperating();
|
||||
break;
|
||||
case Vehicle::Status::CrookedHouseOperating:
|
||||
case Vehicle::Status::crookedHouseOperating:
|
||||
UpdateCrookedHouseOperating();
|
||||
break;
|
||||
case Vehicle::Status::Rotating:
|
||||
case Vehicle::Status::rotating:
|
||||
UpdateRotating();
|
||||
break;
|
||||
case Vehicle::Status::Departing:
|
||||
case Vehicle::Status::departing:
|
||||
UpdateDeparting();
|
||||
break;
|
||||
case Vehicle::Status::Travelling:
|
||||
case Vehicle::Status::travelling:
|
||||
UpdateTravelling();
|
||||
break;
|
||||
case Vehicle::Status::TravellingCableLift:
|
||||
case Vehicle::Status::travellingCableLift:
|
||||
UpdateTravellingCableLift();
|
||||
break;
|
||||
case Vehicle::Status::TravellingBoat:
|
||||
case Vehicle::Status::travellingBoat:
|
||||
UpdateTravellingBoat();
|
||||
break;
|
||||
case Vehicle::Status::Arriving:
|
||||
case Vehicle::Status::arriving:
|
||||
UpdateArriving();
|
||||
break;
|
||||
case Vehicle::Status::UnloadingPassengers:
|
||||
case Vehicle::Status::unloadingPassengers:
|
||||
UpdateUnloadingPassengers();
|
||||
break;
|
||||
case Vehicle::Status::WaitingForCableLift:
|
||||
case Vehicle::Status::waitingForCableLift:
|
||||
UpdateWaitingForCableLift();
|
||||
break;
|
||||
case Vehicle::Status::ShowingFilm:
|
||||
case Vehicle::Status::showingFilm:
|
||||
UpdateShowingFilm();
|
||||
break;
|
||||
case Vehicle::Status::DoingCircusShow:
|
||||
case Vehicle::Status::doingCircusShow:
|
||||
UpdateDoingCircusShow();
|
||||
break;
|
||||
default:
|
||||
@@ -1097,7 +1097,7 @@ void Vehicle::UpdateMovingToEndOfStation()
|
||||
current_station = StationIndex::FromUnderlying(0);
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::WaitingForPassengers);
|
||||
SetState(Vehicle::Status::waitingForPassengers);
|
||||
break;
|
||||
default:
|
||||
{
|
||||
@@ -1132,7 +1132,7 @@ void Vehicle::UpdateMovingToEndOfStation()
|
||||
|
||||
if (curRide->mode == RideMode::race && sub_state >= 40)
|
||||
{
|
||||
SetState(Vehicle::Status::WaitingForPassengers);
|
||||
SetState(Vehicle::Status::waitingForPassengers);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ void Vehicle::UpdateMovingToEndOfStation()
|
||||
current_station = StationIndex::FromUnderlying(station);
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::WaitingForPassengers);
|
||||
SetState(Vehicle::Status::waitingForPassengers);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1194,7 +1194,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se
|
||||
if (!peep[seat].IsNull())
|
||||
{
|
||||
curRide->getStation(current_station).TrainAtStation = RideStation::kNoTrain;
|
||||
SetState(Vehicle::Status::UnloadingPassengers);
|
||||
SetState(Vehicle::Status::unloadingPassengers);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1210,7 +1210,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se
|
||||
return;
|
||||
|
||||
curRide->getStation(current_station).TrainAtStation = RideStation::kNoTrain;
|
||||
SetState(Vehicle::Status::WaitingForPassengers);
|
||||
SetState(Vehicle::Status::waitingForPassengers);
|
||||
}
|
||||
|
||||
static std::optional<uint32_t> ride_get_train_index_from_vehicle(const Ride& ride, EntityId spriteIndex)
|
||||
@@ -1344,8 +1344,8 @@ void Vehicle::UpdateWaitingForPassengers()
|
||||
if (train == nullptr)
|
||||
continue;
|
||||
|
||||
if (train->status == Vehicle::Status::UnloadingPassengers
|
||||
|| train->status == Vehicle::Status::MovingToEndOfStation)
|
||||
if (train->status == Vehicle::Status::unloadingPassengers
|
||||
|| train->status == Vehicle::Status::movingToEndOfStation)
|
||||
{
|
||||
if (train->current_station == current_station)
|
||||
{
|
||||
@@ -1401,7 +1401,7 @@ void Vehicle::UpdateWaitingForPassengers()
|
||||
SetFlag(VehicleFlags::WaitingOnAdjacentStation);
|
||||
}
|
||||
|
||||
SetState(Vehicle::Status::WaitingToDepart);
|
||||
SetState(Vehicle::Status::waitingToDepart);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1444,7 +1444,7 @@ void Vehicle::UpdateDodgemsMode()
|
||||
Invalidate();
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::UnloadingPassengers);
|
||||
SetState(Vehicle::Status::unloadingPassengers);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1492,7 +1492,7 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
{
|
||||
if (!currentStation.Exit.IsNull())
|
||||
{
|
||||
SetState(Vehicle::Status::UnloadingPassengers);
|
||||
SetState(Vehicle::Status::unloadingPassengers);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1506,7 +1506,7 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
{
|
||||
if (!currentStation.Exit.IsNull())
|
||||
{
|
||||
SetState(Vehicle::Status::UnloadingPassengers);
|
||||
SetState(Vehicle::Status::unloadingPassengers);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -1535,7 +1535,7 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
}
|
||||
}
|
||||
|
||||
SetState(Vehicle::Status::Departing);
|
||||
SetState(Vehicle::Status::departing);
|
||||
|
||||
if (curRide->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT)
|
||||
{
|
||||
@@ -1548,7 +1548,7 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
{
|
||||
if (track.element->AsTrack()->HasCableLift())
|
||||
{
|
||||
SetState(Vehicle::Status::WaitingForCableLift, sub_state);
|
||||
SetState(Vehicle::Status::waitingForCableLift, sub_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1558,36 +1558,36 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
case RideMode::dodgems:
|
||||
// Dodgems mode uses sub_state and TimeActive to tell how long
|
||||
// the vehicle has been ridden.
|
||||
SetState(Vehicle::Status::TravellingDodgems);
|
||||
SetState(Vehicle::Status::travellingDodgems);
|
||||
TimeActive = 0;
|
||||
UpdateDodgemsMode();
|
||||
break;
|
||||
case RideMode::swing:
|
||||
SetState(Vehicle::Status::Swinging);
|
||||
SetState(Vehicle::Status::swinging);
|
||||
NumSwings = 0;
|
||||
current_time = -1;
|
||||
UpdateSwinging();
|
||||
break;
|
||||
case RideMode::rotation:
|
||||
SetState(Vehicle::Status::Rotating);
|
||||
SetState(Vehicle::Status::rotating);
|
||||
NumRotations = 0;
|
||||
current_time = -1;
|
||||
UpdateRotating();
|
||||
break;
|
||||
case RideMode::filmAvengingAviators:
|
||||
SetState(Vehicle::Status::SimulatorOperating);
|
||||
SetState(Vehicle::Status::simulatorOperating);
|
||||
current_time = -1;
|
||||
UpdateSimulatorOperating();
|
||||
break;
|
||||
case RideMode::filmThrillRiders:
|
||||
SetState(Vehicle::Status::SimulatorOperating, 1);
|
||||
SetState(Vehicle::Status::simulatorOperating, 1);
|
||||
current_time = -1;
|
||||
UpdateSimulatorOperating();
|
||||
break;
|
||||
case RideMode::beginners:
|
||||
case RideMode::intense:
|
||||
case RideMode::berserk:
|
||||
SetState(Vehicle::Status::TopSpinOperating, sub_state);
|
||||
SetState(Vehicle::Status::topSpinOperating, sub_state);
|
||||
switch (curRide->mode)
|
||||
{
|
||||
case RideMode::beginners:
|
||||
@@ -1612,7 +1612,7 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
break;
|
||||
case RideMode::forwardRotation:
|
||||
case RideMode::backwardRotation:
|
||||
SetState(Vehicle::Status::FerrisWheelRotating, flatRideAnimationFrame);
|
||||
SetState(Vehicle::Status::ferrisWheelRotating, flatRideAnimationFrame);
|
||||
NumRotations = 0;
|
||||
ferris_wheel_var_0 = 8;
|
||||
ferris_wheel_var_1 = 8;
|
||||
@@ -1621,7 +1621,7 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
case RideMode::mouseTails3DFilm:
|
||||
case RideMode::stormChasers3DFilm:
|
||||
case RideMode::spaceRaiders3DFilm:
|
||||
SetState(Vehicle::Status::ShowingFilm, sub_state);
|
||||
SetState(Vehicle::Status::showingFilm, sub_state);
|
||||
switch (curRide->mode)
|
||||
{
|
||||
case RideMode::mouseTails3DFilm:
|
||||
@@ -1643,24 +1643,24 @@ void Vehicle::UpdateWaitingToDepart()
|
||||
UpdateShowingFilm();
|
||||
break;
|
||||
case RideMode::circus:
|
||||
SetState(Vehicle::Status::DoingCircusShow);
|
||||
SetState(Vehicle::Status::doingCircusShow);
|
||||
current_time = -1;
|
||||
UpdateDoingCircusShow();
|
||||
break;
|
||||
case RideMode::spaceRings:
|
||||
SetState(Vehicle::Status::SpaceRingsOperating);
|
||||
SetState(Vehicle::Status::spaceRingsOperating);
|
||||
flatRideAnimationFrame = 0;
|
||||
current_time = -1;
|
||||
UpdateSpaceRingsOperating();
|
||||
break;
|
||||
case RideMode::hauntedHouse:
|
||||
SetState(Vehicle::Status::HauntedHouseOperating);
|
||||
SetState(Vehicle::Status::hauntedHouseOperating);
|
||||
flatRideAnimationFrame = 0;
|
||||
current_time = -1;
|
||||
UpdateHauntedHouseOperating();
|
||||
break;
|
||||
case RideMode::crookedHouse:
|
||||
SetState(Vehicle::Status::CrookedHouseOperating);
|
||||
SetState(Vehicle::Status::crookedHouseOperating);
|
||||
flatRideAnimationFrame = 0;
|
||||
current_time = -1;
|
||||
UpdateCrookedHouseOperating();
|
||||
@@ -1751,7 +1751,7 @@ static bool try_add_synchronised_station(const CoordsXYZ& coords)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (vehicle->status != Vehicle::Status::WaitingToDepart)
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1888,7 +1888,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (v->status != Vehicle::Status::WaitingToDepart && v->velocity != 0)
|
||||
if (v->status != Vehicle::Status::waitingToDepart && v->velocity != 0)
|
||||
{
|
||||
// Here at least one vehicle on the ride is moving.
|
||||
return false;
|
||||
@@ -1926,12 +1926,12 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (otherVehicle->status != Vehicle::Status::Travelling)
|
||||
if (otherVehicle->status != Vehicle::Status::travelling)
|
||||
{
|
||||
if (currentStation == otherVehicle->current_station)
|
||||
{
|
||||
if (otherVehicle->status == Vehicle::Status::WaitingToDepart
|
||||
|| otherVehicle->status == Vehicle::Status::MovingToEndOfStation)
|
||||
if (otherVehicle->status == Vehicle::Status::waitingToDepart
|
||||
|| otherVehicle->status == Vehicle::Status::movingToEndOfStation)
|
||||
{
|
||||
numTrainsAtStation++;
|
||||
}
|
||||
@@ -2154,7 +2154,7 @@ void Vehicle::UpdateTravellingBoatHireSetup()
|
||||
// No longer on a track so reset to 0 for import/export
|
||||
SetTrackDirection(0);
|
||||
SetTrackType(TrackElemType::Flat);
|
||||
SetState(Vehicle::Status::TravellingBoat);
|
||||
SetState(Vehicle::Status::travellingBoat);
|
||||
remaining_distance += 27924;
|
||||
|
||||
UpdateTravellingBoat();
|
||||
@@ -2457,7 +2457,7 @@ void Vehicle::FinishDeparting()
|
||||
currentStation.Depart |= waitingTime;
|
||||
}
|
||||
lost_time_out = 0;
|
||||
SetState(Vehicle::Status::Travelling, 1);
|
||||
SetState(Vehicle::Status::travelling, 1);
|
||||
if (velocity < 0)
|
||||
sub_state = 0;
|
||||
}
|
||||
@@ -2538,7 +2538,7 @@ void Vehicle::UpdateCollisionSetup()
|
||||
return;
|
||||
}
|
||||
|
||||
SetState(Vehicle::Status::Crashed, sub_state);
|
||||
SetState(Vehicle::Status::crashed, sub_state);
|
||||
|
||||
if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_CRASHED))
|
||||
{
|
||||
@@ -2626,7 +2626,7 @@ void Vehicle::UpdateCrashSetup()
|
||||
SimulateCrash();
|
||||
return;
|
||||
}
|
||||
SetState(Vehicle::Status::Crashing, sub_state);
|
||||
SetState(Vehicle::Status::crashing, sub_state);
|
||||
|
||||
if (NumPeepsUntilTrainTail() != 0)
|
||||
{
|
||||
@@ -2752,7 +2752,7 @@ void Vehicle::UpdateTravelling()
|
||||
{
|
||||
if (sub_state <= 1)
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving, 1);
|
||||
SetState(Vehicle::Status::arriving, 1);
|
||||
var_C0 = 0;
|
||||
return;
|
||||
}
|
||||
@@ -2862,7 +2862,7 @@ void Vehicle::UpdateTravelling()
|
||||
if (curRide->mode == RideMode::poweredLaunchPasstrough && velocity < 0)
|
||||
return;
|
||||
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
current_station = _vehicleStationIndex;
|
||||
var_C0 = 0;
|
||||
if (velocity < 0)
|
||||
@@ -2987,7 +2987,7 @@ void Vehicle::UpdateArriving()
|
||||
ClearFlag(VehicleFlags::ReverseInclineCompletedLap);
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::UnloadingPassengers);
|
||||
SetState(Vehicle::Status::unloadingPassengers);
|
||||
return;
|
||||
default:
|
||||
{
|
||||
@@ -3018,7 +3018,7 @@ void Vehicle::UpdateArriving()
|
||||
|
||||
if (curFlags & VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_AT_STATION && !stationBrakesWork)
|
||||
{
|
||||
SetState(Vehicle::Status::Departing, 1);
|
||||
SetState(Vehicle::Status::departing, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3051,20 +3051,20 @@ void Vehicle::UpdateArriving()
|
||||
{
|
||||
if (NumLaps < curRide->numCircuits)
|
||||
{
|
||||
SetState(Vehicle::Status::Departing, 1);
|
||||
SetState(Vehicle::Status::departing, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (NumLaps == curRide->numCircuits && HasFlag(VehicleFlags::ReverseInclineCompletedLap))
|
||||
{
|
||||
SetState(Vehicle::Status::Departing, 1);
|
||||
SetState(Vehicle::Status::departing, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (curRide->numCircuits != 1 && NumLaps < curRide->numCircuits)
|
||||
{
|
||||
SetState(Vehicle::Status::Departing, 1);
|
||||
SetState(Vehicle::Status::departing, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3073,20 +3073,20 @@ void Vehicle::UpdateArriving()
|
||||
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::rideLaunch2, GetLocation());
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::Departing, 1);
|
||||
SetState(Vehicle::Status::departing, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (curRide->mode == RideMode::race && curRide->lifecycleFlags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING)
|
||||
{
|
||||
SetState(Vehicle::Status::Departing, 1);
|
||||
SetState(Vehicle::Status::departing, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
ClearFlag(VehicleFlags::ReverseInclineCompletedLap);
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
SetState(Vehicle::Status::UnloadingPassengers);
|
||||
SetState(Vehicle::Status::unloadingPassengers);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3147,7 +3147,7 @@ void Vehicle::UpdateUnloadingPassengers()
|
||||
{
|
||||
UpdateTestFinish();
|
||||
}
|
||||
SetState(Vehicle::Status::MovingToEndOfStation);
|
||||
SetState(Vehicle::Status::movingToEndOfStation);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3188,7 +3188,7 @@ void Vehicle::UpdateUnloadingPassengers()
|
||||
{
|
||||
UpdateTestFinish();
|
||||
}
|
||||
SetState(Vehicle::Status::MovingToEndOfStation);
|
||||
SetState(Vehicle::Status::movingToEndOfStation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3205,10 +3205,10 @@ void Vehicle::UpdateWaitingForCableLift()
|
||||
if (cableLift == nullptr)
|
||||
return;
|
||||
|
||||
if (cableLift->status != Vehicle::Status::WaitingForPassengers)
|
||||
if (cableLift->status != Vehicle::Status::waitingForPassengers)
|
||||
return;
|
||||
|
||||
cableLift->SetState(Vehicle::Status::WaitingToDepart, sub_state);
|
||||
cableLift->SetState(Vehicle::Status::waitingToDepart, sub_state);
|
||||
cableLift->cable_lift_target = Id;
|
||||
}
|
||||
|
||||
@@ -3272,7 +3272,7 @@ void Vehicle::UpdateTravellingCableLift()
|
||||
|
||||
if (curFlags & VEHICLE_UPDATE_MOTION_TRACK_FLAG_11)
|
||||
{
|
||||
SetState(Vehicle::Status::Travelling, 1);
|
||||
SetState(Vehicle::Status::travelling, 1);
|
||||
lost_time_out = 0;
|
||||
return;
|
||||
}
|
||||
@@ -3331,7 +3331,7 @@ void Vehicle::TryReconnectBoatToTrack(const CoordsXY& currentBoatLocation, const
|
||||
}
|
||||
|
||||
track_progress = 0;
|
||||
SetState(Vehicle::Status::Travelling, sub_state);
|
||||
SetState(Vehicle::Status::travelling, sub_state);
|
||||
_vehicleCurPosition.x = currentBoatLocation.x;
|
||||
_vehicleCurPosition.y = currentBoatLocation.y;
|
||||
}
|
||||
@@ -3792,7 +3792,7 @@ void Vehicle::UpdateSwinging()
|
||||
// swing has to be in slowing down phase
|
||||
if (sub_state == 0)
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
return;
|
||||
}
|
||||
@@ -3889,7 +3889,7 @@ void Vehicle::UpdateFerrisWheelRotating()
|
||||
if (subState != flatRideAnimationFrame)
|
||||
return;
|
||||
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
}
|
||||
|
||||
@@ -3915,7 +3915,7 @@ void Vehicle::UpdateSimulatorOperating()
|
||||
return;
|
||||
}
|
||||
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
}
|
||||
|
||||
@@ -3929,7 +3929,7 @@ void UpdateRotatingEnterprise(Vehicle& vehicle)
|
||||
{
|
||||
if (vehicle.sub_state == 2)
|
||||
{
|
||||
vehicle.SetState(Vehicle::Status::Arriving);
|
||||
vehicle.SetState(Vehicle::Status::arriving);
|
||||
vehicle.var_C0 = 0;
|
||||
return;
|
||||
}
|
||||
@@ -4007,7 +4007,7 @@ void Vehicle::UpdateRotating()
|
||||
{
|
||||
if (sub_state == 2)
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
return;
|
||||
}
|
||||
@@ -4042,7 +4042,7 @@ void Vehicle::UpdateSpaceRingsOperating()
|
||||
}
|
||||
else
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
}
|
||||
}
|
||||
@@ -4070,7 +4070,7 @@ void Vehicle::UpdateHauntedHouseOperating()
|
||||
|
||||
if (current_time + 1 > 1500)
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
return;
|
||||
}
|
||||
@@ -4113,7 +4113,7 @@ void Vehicle::UpdateCrookedHouseOperating()
|
||||
// Originally used an array of size 1 at 0x009A0AC4 and passed the sub state into it.
|
||||
if (static_cast<uint16_t>(current_time + 1) > 600)
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
return;
|
||||
}
|
||||
@@ -4149,7 +4149,7 @@ void Vehicle::UpdateTopSpinOperating()
|
||||
return;
|
||||
}
|
||||
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
}
|
||||
|
||||
@@ -4172,7 +4172,7 @@ void Vehicle::UpdateShowingFilm()
|
||||
}
|
||||
else
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
}
|
||||
}
|
||||
@@ -4193,7 +4193,7 @@ void Vehicle::UpdateDoingCircusShow()
|
||||
}
|
||||
else
|
||||
{
|
||||
SetState(Vehicle::Status::Arriving);
|
||||
SetState(Vehicle::Status::arriving);
|
||||
var_C0 = 0;
|
||||
}
|
||||
}
|
||||
@@ -4325,7 +4325,7 @@ void Vehicle::CrashOnLand()
|
||||
SimulateCrash();
|
||||
return;
|
||||
}
|
||||
SetState(Vehicle::Status::Crashed, sub_state);
|
||||
SetState(Vehicle::Status::crashed, sub_state);
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
InvokeVehicleCrashHook(Id, "land");
|
||||
@@ -4393,7 +4393,7 @@ void Vehicle::CrashOnWater()
|
||||
SimulateCrash();
|
||||
return;
|
||||
}
|
||||
SetState(Vehicle::Status::Crashed, sub_state);
|
||||
SetState(Vehicle::Status::crashed, sub_state);
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
InvokeVehicleCrashHook(Id, "water");
|
||||
@@ -5203,7 +5203,7 @@ void Vehicle::ApplyStopBlockBrake()
|
||||
void Vehicle::ApplyCableLiftBlockBrake(bool brakeClosed)
|
||||
{
|
||||
// If we are already on the cable lift, ignore the brake
|
||||
if (status == Vehicle::Status::TravellingCableLift)
|
||||
if (status == Vehicle::Status::travellingCableLift)
|
||||
return;
|
||||
|
||||
// Slow down if travelling faster than 4mph
|
||||
@@ -5224,7 +5224,7 @@ void Vehicle::ApplyCableLiftBlockBrake(bool brakeClosed)
|
||||
velocity = 0;
|
||||
acceleration = 0;
|
||||
if (!brakeClosed)
|
||||
SetState(Vehicle::Status::WaitingForCableLift, sub_state);
|
||||
SetState(Vehicle::Status::waitingForCableLift, sub_state);
|
||||
else
|
||||
_vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_AT_BLOCK_BRAKE;
|
||||
}
|
||||
@@ -5829,7 +5829,7 @@ static void AnimateSteamLocomotive(Vehicle& vehicle, const CarEntry& carEntry)
|
||||
if (curRide != nullptr)
|
||||
{
|
||||
if (!RideHasStationShelter(*curRide)
|
||||
|| (vehicle.status != Vehicle::Status::MovingToEndOfStation && vehicle.status != Vehicle::Status::Arriving))
|
||||
|| (vehicle.status != Vehicle::Status::movingToEndOfStation && vehicle.status != Vehicle::Status::arriving))
|
||||
{
|
||||
CoordsXYZ steamOffset = ComputeSteamOffset(
|
||||
carEntry.SteamEffect.Vertical, carEntry.SteamEffect.Longitudinal, vehicle.pitch, vehicle.Orientation);
|
||||
@@ -6405,7 +6405,7 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth
|
||||
return false;
|
||||
}
|
||||
|
||||
if (collideVehicle->status == Vehicle::Status::TravellingBoat && sub_state == BoatHireSubState::EnteringReturnPosition)
|
||||
if (collideVehicle->status == Vehicle::Status::travellingBoat && sub_state == BoatHireSubState::EnteringReturnPosition)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -6419,7 +6419,7 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth
|
||||
return true;
|
||||
}
|
||||
|
||||
if (status == Vehicle::Status::MovingToEndOfStation)
|
||||
if (status == Vehicle::Status::movingToEndOfStation)
|
||||
{
|
||||
if (Orientation == 0)
|
||||
{
|
||||
@@ -6451,8 +6451,8 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth
|
||||
}
|
||||
}
|
||||
|
||||
if (collideVehicle->status == Vehicle::Status::TravellingBoat && status != Vehicle::Status::Arriving
|
||||
&& status != Vehicle::Status::Travelling)
|
||||
if (collideVehicle->status == Vehicle::Status::travellingBoat && status != Vehicle::Status::arriving
|
||||
&& status != Vehicle::Status::travelling)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -8481,7 +8481,7 @@ void Vehicle::UpdateCrossings() const
|
||||
MapGetTrackElementAtOfTypeSeq(frontVehicle->TrackLocation, frontVehicle->GetTrackType(), 0) };
|
||||
int32_t curZ = frontVehicle->TrackLocation.z;
|
||||
|
||||
if (xyElement.element != nullptr && status != Vehicle::Status::Arriving)
|
||||
if (xyElement.element != nullptr && status != Vehicle::Status::arriving)
|
||||
{
|
||||
int16_t autoReserveAhead = 4 + abs(velocity) / 150000;
|
||||
int16_t crossingBonus = 0;
|
||||
@@ -8539,7 +8539,7 @@ void Vehicle::UpdateCrossings() const
|
||||
|
||||
// Ensure trains near a station don't block possible crossings after the stop,
|
||||
// except when they are departing
|
||||
if (xyElement.element->AsTrack()->IsStation() && status != Vehicle::Status::Departing)
|
||||
if (xyElement.element->AsTrack()->IsStation() && status != Vehicle::Status::departing)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -8554,7 +8554,7 @@ void Vehicle::UpdateCrossings() const
|
||||
}
|
||||
|
||||
// Ensure departing trains don't clear blocked crossings behind them that might already be blocked by another incoming train
|
||||
uint8_t freeCount = travellingForwards && status != Vehicle::Status::Departing ? 3 : 1;
|
||||
uint8_t freeCount = travellingForwards && status != Vehicle::Status::departing ? 3 : 1;
|
||||
while (freeCount-- > 0)
|
||||
{
|
||||
if (travellingForwards)
|
||||
|
||||
+31
-31
@@ -68,37 +68,37 @@ struct Vehicle : EntityBase
|
||||
|
||||
enum class Status : uint8_t
|
||||
{
|
||||
MovingToEndOfStation,
|
||||
WaitingForPassengers,
|
||||
WaitingToDepart,
|
||||
Departing,
|
||||
Travelling,
|
||||
Arriving,
|
||||
UnloadingPassengers,
|
||||
TravellingBoat,
|
||||
Crashing,
|
||||
Crashed,
|
||||
TravellingDodgems,
|
||||
Swinging,
|
||||
Rotating,
|
||||
FerrisWheelRotating,
|
||||
SimulatorOperating,
|
||||
ShowingFilm,
|
||||
SpaceRingsOperating,
|
||||
TopSpinOperating,
|
||||
HauntedHouseOperating,
|
||||
DoingCircusShow,
|
||||
CrookedHouseOperating,
|
||||
WaitingForCableLift,
|
||||
TravellingCableLift,
|
||||
Stopping,
|
||||
WaitingForPassengers17,
|
||||
WaitingToStart,
|
||||
Starting,
|
||||
Operating1A,
|
||||
Stopping1B,
|
||||
UnloadingPassengers1C,
|
||||
StoppedByBlockBrakes
|
||||
movingToEndOfStation,
|
||||
waitingForPassengers,
|
||||
waitingToDepart,
|
||||
departing,
|
||||
travelling,
|
||||
arriving,
|
||||
unloadingPassengers,
|
||||
travellingBoat,
|
||||
crashing,
|
||||
crashed,
|
||||
travellingDodgems,
|
||||
swinging,
|
||||
rotating,
|
||||
ferrisWheelRotating,
|
||||
simulatorOperating,
|
||||
showingFilm,
|
||||
spaceRingsOperating,
|
||||
topSpinOperating,
|
||||
hauntedHouseOperating,
|
||||
doingCircusShow,
|
||||
crookedHouseOperating,
|
||||
waitingForCableLift,
|
||||
travellingCableLift,
|
||||
stopping,
|
||||
waitingForPassengers17,
|
||||
waitingToStart,
|
||||
starting,
|
||||
operating1A,
|
||||
stopping1B,
|
||||
unloadingPassengers1C,
|
||||
stoppedByBlockBrakes,
|
||||
};
|
||||
|
||||
Type SubType;
|
||||
|
||||
@@ -23,37 +23,37 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
static const DukEnumMap<Vehicle::Status> VehicleStatusMap(
|
||||
{
|
||||
{ "moving_to_end_of_station", Vehicle::Status::MovingToEndOfStation },
|
||||
{ "waiting_for_passengers", Vehicle::Status::WaitingForPassengers },
|
||||
{ "waiting_to_depart", Vehicle::Status::WaitingToDepart },
|
||||
{ "departing", Vehicle::Status::Departing },
|
||||
{ "travelling", Vehicle::Status::Travelling },
|
||||
{ "arriving", Vehicle::Status::Arriving },
|
||||
{ "unloading_passengers", Vehicle::Status::UnloadingPassengers },
|
||||
{ "travelling_boat", Vehicle::Status::TravellingBoat },
|
||||
{ "crashing", Vehicle::Status::Crashing },
|
||||
{ "crashed", Vehicle::Status::Crashed },
|
||||
{ "travelling_dodgems", Vehicle::Status::TravellingDodgems },
|
||||
{ "swinging", Vehicle::Status::Swinging },
|
||||
{ "rotating", Vehicle::Status::Rotating },
|
||||
{ "ferris_wheel_rotating", Vehicle::Status::FerrisWheelRotating },
|
||||
{ "simulator_operating", Vehicle::Status::SimulatorOperating },
|
||||
{ "showing_film", Vehicle::Status::ShowingFilm },
|
||||
{ "space_rings_operating", Vehicle::Status::SpaceRingsOperating },
|
||||
{ "top_spin_operating", Vehicle::Status::TopSpinOperating },
|
||||
{ "haunted_house_operating", Vehicle::Status::HauntedHouseOperating },
|
||||
{ "doing_circus_show", Vehicle::Status::DoingCircusShow },
|
||||
{ "crooked_house_operating", Vehicle::Status::CrookedHouseOperating },
|
||||
{ "waiting_for_cable_lift", Vehicle::Status::WaitingForCableLift },
|
||||
{ "travelling_cable_lift", Vehicle::Status::TravellingCableLift },
|
||||
{ "stopping", Vehicle::Status::Stopping },
|
||||
{ "waiting_for_passengers_17", Vehicle::Status::WaitingForPassengers17 },
|
||||
{ "waiting_to_start", Vehicle::Status::WaitingToStart },
|
||||
{ "starting", Vehicle::Status::Starting },
|
||||
{ "operating_1a", Vehicle::Status::Operating1A },
|
||||
{ "stopping_1b", Vehicle::Status::Stopping1B },
|
||||
{ "unloading_passengers_1c", Vehicle::Status::UnloadingPassengers1C },
|
||||
{ "stopped_by_block_brake", Vehicle::Status::StoppedByBlockBrakes },
|
||||
{ "moving_to_end_of_station", Vehicle::Status::movingToEndOfStation },
|
||||
{ "waiting_for_passengers", Vehicle::Status::waitingForPassengers },
|
||||
{ "waiting_to_depart", Vehicle::Status::waitingToDepart },
|
||||
{ "departing", Vehicle::Status::departing },
|
||||
{ "travelling", Vehicle::Status::travelling },
|
||||
{ "arriving", Vehicle::Status::arriving },
|
||||
{ "unloading_passengers", Vehicle::Status::unloadingPassengers },
|
||||
{ "travelling_boat", Vehicle::Status::travellingBoat },
|
||||
{ "crashing", Vehicle::Status::crashing },
|
||||
{ "crashed", Vehicle::Status::crashed },
|
||||
{ "travelling_dodgems", Vehicle::Status::travellingDodgems },
|
||||
{ "swinging", Vehicle::Status::swinging },
|
||||
{ "rotating", Vehicle::Status::rotating },
|
||||
{ "ferris_wheel_rotating", Vehicle::Status::ferrisWheelRotating },
|
||||
{ "simulator_operating", Vehicle::Status::simulatorOperating },
|
||||
{ "showing_film", Vehicle::Status::showingFilm },
|
||||
{ "space_rings_operating", Vehicle::Status::spaceRingsOperating },
|
||||
{ "top_spin_operating", Vehicle::Status::topSpinOperating },
|
||||
{ "haunted_house_operating", Vehicle::Status::hauntedHouseOperating },
|
||||
{ "doing_circus_show", Vehicle::Status::doingCircusShow },
|
||||
{ "crooked_house_operating", Vehicle::Status::crookedHouseOperating },
|
||||
{ "waiting_for_cable_lift", Vehicle::Status::waitingForCableLift },
|
||||
{ "travelling_cable_lift", Vehicle::Status::travellingCableLift },
|
||||
{ "stopping", Vehicle::Status::stopping },
|
||||
{ "waiting_for_passengers_17", Vehicle::Status::waitingForPassengers17 },
|
||||
{ "waiting_to_start", Vehicle::Status::waitingToStart },
|
||||
{ "starting", Vehicle::Status::starting },
|
||||
{ "operating_1a", Vehicle::Status::operating1A },
|
||||
{ "stopping_1b", Vehicle::Status::stopping1B },
|
||||
{ "unloading_passengers_1c", Vehicle::Status::unloadingPassengers1C },
|
||||
{ "stopped_by_block_brake", Vehicle::Status::stoppedByBlockBrakes },
|
||||
});
|
||||
|
||||
ScVehicle::ScVehicle(EntityId id)
|
||||
|
||||
Reference in new issue
Block a user