diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 76386bd1f7..a3f86b6ff6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.11 (in development) ------------------------------------------------------------------------ +- Fix: [#866] Boat Hire boats get stuck entering track. 0.4.10 (2024-04-02) ------------------------------------------------------------------------ diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index c4df36b1ea..1e32583e17 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -46,7 +46,7 @@ using namespace OpenRCT2; // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "0" +#define NETWORK_STREAM_VERSION "1" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 46fd05fba5..667c75c353 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3771,7 +3771,7 @@ void Vehicle::UpdateMotionBoatHire() return; bool do_Loc6DAA97 = false; - if (sub_state != 1) + if (sub_state != BoatHireSubState::EnteringReturnPosition) { do_Loc6DAA97 = true; } @@ -3908,12 +3908,12 @@ void Vehicle::UpdateBoatLocation() if (location.ToTileStart() == returnPosition.ToCoordsXY()) { - sub_state = 1; + sub_state = BoatHireSubState::EnteringReturnPosition; BoatLocation = location.ToTileStart(); return; } - sub_state = 0; + sub_state = BoatHireSubState::Normal; uint8_t curDirection = ((Orientation + 19) >> 3) & 3; uint8_t randDirection = ScenarioRand() & 3; @@ -6638,12 +6638,17 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth } } - if (!mayCollide) + if (!mayCollide || collideVehicle == nullptr) { CollisionDetectionTimer = 0; return false; } + if (collideVehicle->status == Vehicle::Status::TravellingBoat && sub_state == BoatHireSubState::EnteringReturnPosition) + { + return false; + } + CollisionDetectionTimer++; if (CollisionDetectionTimer < 200) { @@ -6653,8 +6658,6 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth return true; } - // TODO Is it possible for collideVehicle to be NULL? - if (status == Vehicle::Status::MovingToEndOfStation) { if (Orientation == 0) diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index cfb8c660a4..15db70bd94 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -425,6 +425,12 @@ enum class MiniGolfAnimation : uint8_t Putt, }; +enum BoatHireSubState : uint8_t +{ + Normal, + EnteringReturnPosition, +}; + namespace VehicleFlags { constexpr uint32_t OnLiftHill = (1 << 0);