From 83d840f3a5d63a0773af774e9d63db389e7e23ab Mon Sep 17 00:00:00 2001 From: frutiemax Date: Fri, 23 Dec 2022 21:34:45 -0500 Subject: [PATCH] Remove goto label loc_6DCD6B --- src/openrct2/ride/Vehicle.cpp | 45 ++++++++++++++++------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 26ff935273..f7c245ba8f 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -8605,7 +8605,27 @@ Loc6DCC2C: otherVehicleIndex = EntityId::FromUnderlying(var_44); // Possibly wrong?. if (UpdateMotionCollisionDetection(trackPos, &otherVehicleIndex)) { - goto Loc6DCD6B; + _vehicleVelocityF64E0C -= remaining_distance - 0x368A; + remaining_distance = 0x368A; + { + Vehicle* vEBP = GetEntity(otherVehicleIndex); + if (vEBP == nullptr) + { + return; + } + Vehicle* vEDI = gCurrentVehicle; + if (abs(vEDI->velocity - vEBP->velocity) > 14.0_mph) + { + if (!(carEntry->flags & CAR_ENTRY_FLAG_BOAT_HIRE_COLLISION_DETECTION)) + { + _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_COLLISION; + } + } + vEDI->velocity = vEBP->velocity >> 1; + vEBP->velocity = vEDI->velocity >> 1; + } + _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_2; + goto Loc6DC99A; } } } @@ -8625,29 +8645,6 @@ Loc6DCD4A: _vehicleVelocityF64E0C -= remaining_distance - 0x368A; remaining_distance = 0x368A; goto Loc6DC99A; - -Loc6DCD6B: - _vehicleVelocityF64E0C -= remaining_distance - 0x368A; - remaining_distance = 0x368A; - { - Vehicle* vEBP = GetEntity(otherVehicleIndex); - if (vEBP == nullptr) - { - return; - } - Vehicle* vEDI = gCurrentVehicle; - if (abs(vEDI->velocity - vEBP->velocity) > 14.0_mph) - { - if (!(carEntry->flags & CAR_ENTRY_FLAG_BOAT_HIRE_COLLISION_DETECTION)) - { - _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_COLLISION; - } - } - vEDI->velocity = vEBP->velocity >> 1; - vEBP->velocity = vEDI->velocity >> 1; - } - _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_2; - goto Loc6DC99A; } void Vehicle::Loc6DCDE4(const Ride& curRide)