1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

No need to double check if its Guest or Staff

This commit is contained in:
ζeh Matt
2025-09-12 14:58:07 +03:00
parent ce3da4012e
commit 2e6ffa4285

View File

@@ -567,12 +567,12 @@ namespace OpenRCT2::PathFinding
*/
static uint8_t PeepPathfindGetMaxNumberJunctions(Peep& peep)
{
if (peep.Is<Staff>())
return kMaxJunctionsStaff;
auto* guest = peep.As<Guest>();
if (guest == nullptr)
{
// Peep can be only Staff and Guest, so when not a Guest it means its Staff.
return kMaxJunctionsStaff;
}
bool isLeavingPark = (guest->PeepFlags & PEEP_FLAGS_LEAVING_PARK) != 0;
if (isLeavingPark && guest->GuestIsLostCountdown < 90)