mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
Increase handyman randomness in queue (#12145)
* Increase randomness when handyman is on queue path * Add myself to contributors * Refactor hex variable probabilities * Add check if queue is connected to a ride * Update changelog * Bump network version * Update replays Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
// This string specifies which version of network stream current build uses.
|
||||
// It is used for making sure only compatible builds get connected, even within
|
||||
// single OpenRCT2 version.
|
||||
#define NETWORK_STREAM_VERSION "20"
|
||||
#define NETWORK_STREAM_VERSION "21"
|
||||
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
|
||||
|
||||
static Peep* _pickup_peep = nullptr;
|
||||
|
||||
@@ -643,7 +643,12 @@ bool Staff::DoHandymanPathFinding()
|
||||
bool chooseRandom = true;
|
||||
if (litterDirection != INVALID_DIRECTION && pathDirections & (1 << litterDirection))
|
||||
{
|
||||
if ((scenario_rand() & 0xFFFF) >= 0x1999)
|
||||
/// Check whether path is a queue path and connected to a ride
|
||||
bool connectedQueue = (pathElement->IsQueue() && pathElement->GetRideIndex() != RIDE_ID_NULL);
|
||||
/// When in a queue path make the probability of following litter much lower (10% instead of 90%)
|
||||
/// as handymen often get stuck when there is litter on a normal path next to a queue they are in
|
||||
uint32_t chooseRandomProbability = connectedQueue ? 0xE666 : 0x1999;
|
||||
if ((scenario_rand() & 0xFFFF) >= chooseRandomProbability)
|
||||
{
|
||||
chooseRandom = false;
|
||||
newDirection = litterDirection;
|
||||
|
||||
Reference in New Issue
Block a user