From 8c5b56dda133860a2005ce601f85c46100a3ad37 Mon Sep 17 00:00:00 2001 From: oli414 Date: Wed, 2 May 2018 18:12:13 +0200 Subject: [PATCH] Fix #7418: Staff walk off paths with a connection but no adjacent path --- distribution/changelog.txt | 1 + src/openrct2/peep/Peep.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 824b215186..8f719b6b9c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -25,6 +25,7 @@ - Fix: [#7382] Opening the mini-map reverts the size of the land tool to 1x1, regardless of what was selected before. - Fix: [#7402] Edges of neigbouring footpaths stay connected after removing a path that's underneath a ride entrance. - Fix: [#7405] Rides can be covered by placing scenery underneath them. +- Fix: [#7418] Staff walk off paths with a connection but no adjacent path. - Fix: [#7436] Only the first 32 vehicles of a train can be painted. - Fix: [#7480] Graphs skip values of 0. - Improved: [#2989] Multiplayer window now changes title when tab changes. diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 9c76f087dc..bb8e1fc273 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -3272,6 +3272,17 @@ void rct_peep::PerformNextAction(uint8 & pathing_result, rct_tile_element * & ti return; } + if (type == PEEP_TYPE_STAFF && !GetNextIsSurface()) + { + // Prevent staff from leaving the path on their own unless they're allowed to mow. + if (!((this->staff_orders & STAFF_ORDERS_MOWING) && this->staff_mowing_timeout >= 12)) + { + peep_return_to_centre_of_tile(this); + return; + } + } + + // The peep is on a surface and not on a path next_x = actionX & 0xFFE0; next_y = actionY & 0xFFE0; next_z = tileElement->base_height;