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

Part of #9473: vehicle_current_tower_element_is_top to Vehicle::CurrentTowerElementIsTop

This commit is contained in:
hdpoliveira
2020-04-10 05:32:47 -03:00
parent 49b37aafe8
commit bbdd70395f
2 changed files with 5 additions and 4 deletions

View File

@@ -3084,9 +3084,9 @@ void vehicle_test_reset(Vehicle* vehicle)
window_invalidate_by_number(WC_RIDE, vehicle->ride);
}
static bool vehicle_current_tower_element_is_top(Vehicle* vehicle)
bool Vehicle::CurrentTowerElementIsTop()
{
TileElement* tileElement = map_get_track_element_at_of_type(vehicle->TrackLocation, vehicle->track_type >> 2);
TileElement* tileElement = map_get_track_element_at_of_type(TrackLocation, track_type >> 2);
if (tileElement != nullptr)
{
while (!tileElement->IsLastForTile())
@@ -3367,7 +3367,7 @@ void Vehicle::UpdateDeparting()
}
}
if (!vehicle_current_tower_element_is_top(this))
if (!CurrentTowerElementIsTop())
{
if (curRide->mode == RIDE_MODE_FREEFALL_DROP)
Invalidate();
@@ -3733,7 +3733,7 @@ void Vehicle::UpdateTravelling()
}
else
{
if (vehicle_current_tower_element_is_top(this))
if (CurrentTowerElementIsTop())
{
velocity = 0;
sub_state = 2;

View File

@@ -343,6 +343,7 @@ private:
int32_t UpdateMotionDodgems();
void UpdateAdditionalAnimation();
void CheckIfMissing();
bool CurrentTowerElementIsTop();
};
struct train_ref