mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #21745 from rik-smeets/fix-stuck-boat-hire
Fix #866: Boat Hire boats get stuck entering track
This commit is contained in:
commit
4e7d5d987a
|
@ -1,5 +1,6 @@
|
|||
0.4.11 (in development)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: [#866] Boat Hire boats get stuck entering track.
|
||||
|
||||
0.4.10 (2024-04-02)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -425,6 +425,12 @@ enum class MiniGolfAnimation : uint8_t
|
|||
Putt,
|
||||
};
|
||||
|
||||
enum BoatHireSubState : uint8_t
|
||||
{
|
||||
Normal,
|
||||
EnteringReturnPosition,
|
||||
};
|
||||
|
||||
namespace VehicleFlags
|
||||
{
|
||||
constexpr uint32_t OnLiftHill = (1 << 0);
|
||||
|
|
Loading…
Reference in New Issue