mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 00:58:33 +00:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user