diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 19d2272f91..e8154e3902 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -96,7 +96,7 @@ InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoord case EntityType::Vehicle: { auto vehicle = sprite->As(); - if (vehicle != nullptr && vehicle->ride_subtype != OBJECT_ENTRY_INDEX_NULL) + if (vehicle != nullptr && !vehicle->IsCableLift()) vehicle->SetMapToolbar(); else info.SpriteType = ViewportInteractionItem::None; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 568181b484..1066ba6fc7 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1853,8 +1853,7 @@ void Vehicle::GetLiftHillSound(Ride* curRide, SoundIdVolume& curSound) */ void Vehicle::Update() { - // The cable lift uses a ride entry index of NULL - if (ride_subtype == OBJECT_ENTRY_INDEX_NULL) + if (IsCableLift()) { CableLiftUpdate(); return; @@ -7067,6 +7066,11 @@ void Vehicle::UpdateReverserCarBogies() MoveTo({ TrackLocation.x + moveInfo->x, TrackLocation.y + moveInfo->y, z }); } +bool Vehicle::IsCableLift() const +{ + return ride_subtype == OBJECT_ENTRY_INDEX_NULL; +} + /** * Collision Detection * rct2: 0x006DD078 @@ -7142,7 +7146,7 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth if (z_diff > 16) continue; - if (vehicle2->ride_subtype == OBJECT_ENTRY_INDEX_NULL) + if (vehicle2->IsCableLift()) continue; auto collideCarEntry = vehicle2->Entry(); diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 761cf057ac..b2707d4519 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -271,6 +271,7 @@ struct Vehicle : EntityBase void ApplyMass(int16_t appliedMass); void Serialise(DataSerialiser& stream); void Paint(PaintSession& session, int32_t imageDirection) const; + bool IsCableLift() const; friend void UpdateRotatingDefault(Vehicle& vehicle); friend void UpdateRotatingEnterprise(Vehicle& vehicle); diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index d7a51caac8..628f9d550e 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -3678,7 +3678,7 @@ void Vehicle::Paint(PaintSession& session, int32_t imageDirection) const } int32_t zOffset = 0; - if (ride_subtype == OBJECT_ENTRY_INDEX_NULL) + if (IsCableLift()) { carEntry = &CableLiftVehicle; }