From cafbd4681ea291dc865d6ef8b845ddd698b3bfa7 Mon Sep 17 00:00:00 2001 From: privatecore Date: Sat, 20 Dec 2025 23:51:32 +0100 Subject: [PATCH] Hotfix after recent changes related to the refactoring of IsMovingAllowed (#1933) Hotfix for the issue where bots can't enter/move on transports (elevators, zeppelins, ships, etc.). Change the logic to determine if bot is on a vehicle. According to the current implementation in AzerothCore, `GetVehicle()` is the most common approach for this. Additionally, other checks related to the vehicle: `GetBase`, `IsAlive`, `GetVehicleInfo`, and `GetSeatForPassenger` -- are processed inside `IsInVehicle`. This should be more than enough to determine if the bot is on a vehicle and can/cant control it. Issue: https://github.com/mod-playerbots/mod-playerbots/issues/1927 --- src/strategy/actions/MovementActions.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 55bebf2e..ed650fbf 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -972,8 +972,7 @@ bool MovementAction::IsMovingAllowed() // Vehicle state: is in the vehicle and can control it (rare, content-specific). // We need to check charmed state AFTER vehicle one, cuz that's how it works: // passengers are set to charmed by vehicle with CHARM_TYPE_VEHICLE. - if ((bot->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !botAI->IsInVehicle(true)) || - bot->IsCharmed()) + if ((bot->GetVehicle() && !botAI->IsInVehicle(true)) || bot->IsCharmed()) return false; return true;