Create Vehicle::IsCableLift()

This commit is contained in:
frutiemax authored and GitHub committed 2022-12-22 12:26:35 +01:00
1 parent a862fbd07f
commit 29d40d0cba
4 files changed
+10 -5

No files matched your search

@@ -96,7 +96,7 @@ InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoord
case EntityType::Vehicle:
{
auto vehicle = sprite->As<Vehicle>();
if (vehicle != nullptr && vehicle->ride_subtype != OBJECT_ENTRY_INDEX_NULL)
if (vehicle != nullptr && !vehicle->IsCableLift())
vehicle->SetMapToolbar();
else
info.SpriteType = ViewportInteractionItem::None;
+7 -3
View File
@@ -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();
+1
View File
@@ -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);
+1 -1
View File
@@ -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;
}