mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/RPG): LOS check on MoveRandomNear samples to avoid tree tunneling
This commit is contained in:
parent
1ba36e9c64
commit
73bf6f0606
@ -554,6 +554,13 @@ bool NewRpgBaseAction::MoveRandomNear(float moveStep, MovementPriority priority,
|
|||||||
if (map->IsInWater(bot->GetPhaseMask(), dx, dy, dz, bot->GetCollisionHeight()))
|
if (map->IsInWater(bot->GetPhaseMask(), dx, dy, dz, bot->GetCollisionHeight()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Reject samples whose straight-line passes through visual
|
||||||
|
// obstacles (trees, models) that aren't in the navmesh. The
|
||||||
|
// smooth-path step can otherwise interpolate a waypoint inside
|
||||||
|
// a tree, making the bot visibly walk through it.
|
||||||
|
if (!bot->IsWithinLOS(dx, dy, dz))
|
||||||
|
continue;
|
||||||
|
|
||||||
bool moved = MoveTo(bot->GetMapId(), dx, dy, dz, false, false, false, true, priority);
|
bool moved = MoveTo(bot->GetMapId(), dx, dy, dz, false, false, false, true, priority);
|
||||||
if (moved)
|
if (moved)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user