diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index e7b3690ceb..6c15746a21 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -567,12 +567,12 @@ namespace OpenRCT2::PathFinding */ static uint8_t PeepPathfindGetMaxNumberJunctions(Peep& peep) { - if (peep.Is()) - return kMaxJunctionsStaff; - auto* guest = peep.As(); 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)