Add bots to transports

Add bots to transports they're on so they actually move with it.
This commit is contained in:
Revision
2024-07-28 02:43:22 +02:00
parent 13647f286a
commit 78832f106e

View File

@@ -849,6 +849,21 @@ void MovementAction::UpdateMovementState()
if (bot->IsFlying()) if (bot->IsFlying())
bot->UpdateSpeed(MOVE_FLIGHT, true); bot->UpdateSpeed(MOVE_FLIGHT, true);
Transport* newTransport = bot->GetMap()->GetTransportForPos(bot->GetPhaseMask(), bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), bot);
if (newTransport != bot->GetTransport())
{
LOG_DEBUG("playerbots", "Bot {} is on a transport", IsMovingAllowed());
if (bot->GetTransport())
bot->GetTransport()->RemovePassenger(bot, true);
if (newTransport)
newTransport->AddPassenger(bot, true);
bot->StopMovingOnCurrentPos();
}
// Temporary speed increase in group // Temporary speed increase in group
//if (botAI->HasRealPlayerMaster()) //if (botAI->HasRealPlayerMaster())
//bot->SetSpeedRate(MOVE_RUN, 1.1f); //bot->SetSpeedRate(MOVE_RUN, 1.1f);