mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
feat(Core/Movement): BoardTransport mode 1 — teleport directly to boarding edge when transportTeleportType >= 1
This commit is contained in:
parent
6aea0c2ba7
commit
f6c41f57e4
@ -3470,7 +3470,7 @@ bool MovementAction::BoardTransport(Transport* transport)
|
||||
if (bot->GetTransport() == transport)
|
||||
return true;
|
||||
|
||||
// Check if bot is on the transport surface
|
||||
// Check if bot is already on the transport surface (walked into range).
|
||||
float probeZ = std::max(bot->GetPositionZ(), transport->GetPositionZ());
|
||||
Transport* surface = GetTransportForPosTolerant(map, bot, bot->GetPhaseMask(), bot->GetPositionX(),
|
||||
bot->GetPositionY(), probeZ);
|
||||
@ -3483,7 +3483,34 @@ bool MovementAction::BoardTransport(Transport* transport)
|
||||
transport->GetPositionY(), transport->GetPositionZ());
|
||||
return true;
|
||||
}
|
||||
// Not on surface — move toward the transport
|
||||
|
||||
// Teleport-onto mode (transportTeleportType >= 1): skip the walk-toward
|
||||
// phase and jump directly to a boarding edge. Matches reference's
|
||||
// `UseTransport(...telep=true)` shortcut for invisible / random bots
|
||||
// and any caller that doesn't want the visible boarding sequence.
|
||||
if (sPlayerbotAIConfig.transportTeleportType >= 1)
|
||||
{
|
||||
float edgeX, edgeY, edgeZ;
|
||||
if (FindBoardingPointOnTransport(map, transport, transport,
|
||||
transport->GetPositionX(), transport->GetPositionY(),
|
||||
transport->GetPositionZ(),
|
||||
bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(),
|
||||
edgeX, edgeY, edgeZ))
|
||||
{
|
||||
if (bot->TeleportTo(map->GetId(), edgeX, edgeY, edgeZ, bot->GetOrientation()))
|
||||
{
|
||||
transport->AddPassenger(bot, true);
|
||||
bot->StopMovingOnCurrentPos();
|
||||
EmitDebugMove("Transport:board", "teleport-skip-walk",
|
||||
edgeX, edgeY, edgeZ);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Fall through to walk-toward if no boarding point or teleport
|
||||
// failed — better than refusing the board outright.
|
||||
}
|
||||
|
||||
// Walk-toward mode (transportTeleportType == 0, or mode>=1 fallback).
|
||||
float destX = transport->GetPositionX();
|
||||
float destY = transport->GetPositionY();
|
||||
float destZ = transport->GetPositionZ();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user