1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 20:13:07 +01:00

Part of #9473: vehicle_update_showing_film to Vehicle::UpdateShowingFilm

This commit is contained in:
hdpoliveira
2020-04-10 04:26:56 -03:00
parent a789241a73
commit 3d673e7d5d
2 changed files with 9 additions and 9 deletions

View File

@@ -48,7 +48,6 @@
static void vehicle_update_crossings(const Vehicle* vehicle);
static void vehicle_claxon(const Vehicle* vehicle);
static void vehicle_update_showing_film(Vehicle* vehicle);
static void vehicle_update_doing_circus_show(Vehicle* vehicle);
static void vehicle_finish_departing(Vehicle* vehicle);
static void vehicle_update_motion_boat_hire(Vehicle* vehicle);
@@ -2039,7 +2038,7 @@ void Vehicle::Update()
UpdateWaitingForCableLift();
break;
case VEHICLE_STATUS_SHOWING_FILM:
vehicle_update_showing_film(this);
UpdateShowingFilm();
break;
case VEHICLE_STATUS_DOING_CIRCUS_SHOW:
vehicle_update_doing_circus_show(this);
@@ -2639,7 +2638,7 @@ void Vehicle::UpdateWaitingToDepart()
break;
}
current_time = -1;
vehicle_update_showing_film(this);
UpdateShowingFilm();
break;
case RIDE_MODE_CIRCUS_SHOW:
SetState(VEHICLE_STATUS_DOING_CIRCUS_SHOW);
@@ -5082,23 +5081,23 @@ void Vehicle::UpdateTopSpinOperating()
*
* rct2: 0x006D95AD
*/
static void vehicle_update_showing_film(Vehicle* vehicle)
void Vehicle::UpdateShowingFilm()
{
int32_t currentTime, totalTime;
if (_vehicleBreakdown == 0)
return;
totalTime = RideFilmLength[vehicle->sub_state];
currentTime = vehicle->current_time + 1;
totalTime = RideFilmLength[sub_state];
currentTime = current_time + 1;
if (currentTime <= totalTime)
{
vehicle->current_time = currentTime;
current_time = currentTime;
}
else
{
vehicle->SetState(VEHICLE_STATUS_ARRIVING);
vehicle->var_C0 = 0;
SetState(VEHICLE_STATUS_ARRIVING);
var_C0 = 0;
}
}

View File

@@ -328,6 +328,7 @@ private:
void UpdateArriving();
void UpdateUnloadingPassengers();
void UpdateWaitingForCableLift();
void UpdateShowingFilm();
};
struct train_ref