Skip to content

Commit cafbd46

Browse files
authored
Hotfix after recent changes related to the refactoring of IsMovingAllowed (mod-playerbots#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: mod-playerbots#1927
1 parent f5c84ee commit cafbd46

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/strategy/actions/MovementActions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,7 @@ bool MovementAction::IsMovingAllowed()
972972
// Vehicle state: is in the vehicle and can control it (rare, content-specific).
973973
// We need to check charmed state AFTER vehicle one, cuz that's how it works:
974974
// passengers are set to charmed by vehicle with CHARM_TYPE_VEHICLE.
975-
if ((bot->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !botAI->IsInVehicle(true)) ||
976-
bot->IsCharmed())
975+
if ((bot->GetVehicle() && !botAI->IsInVehicle(true)) || bot->IsCharmed())
977976
return false;
978977

979978
return true;

0 commit comments

Comments
 (0)