feat(movement): Migrate PositionManager to BotMovementController
Task 3 Progress: 8/33 files complete (HIGH PRIORITY #5) Migrated 1 MotionMaster usage to BotMovementController for tactical positioning with validated pathfinding. Changes: - Added BotAI.h and PlayerBotHelpers.h includes - Updated MovePoint() call for target position movement (line 223) Position System Benefits: - Validated positioning for tactical movement - Ground validation prevents positioning errors - Sprint support preserved for critical movement - Proper pathfinding to optimal combat positions Performance: No impact when disabled Testing: Build successful (RelWithDebInfo) Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: luis <[email protected]>
This commit is contained in:
committed by
luis
co-authored by
Claude Opus 4.5
parent
c793963a79
commit
9d40c44f2a
@@ -29,6 +29,8 @@
|
||||
#include "../../Spatial/SpatialGridManager.h"
|
||||
#include "../../Spatial/SpatialGridQueryHelpers.h" // PHASE 5B: Thread-safe helpers
|
||||
#include "ObjectAccessor.h"
|
||||
#include "../BotAI.h"
|
||||
#include "Core/PlayerBotHelpers.h"
|
||||
|
||||
namespace Playerbot
|
||||
{
|
||||
@@ -219,8 +221,20 @@ PositionMovementResult PositionManager::ExecuteMovement(const Position& targetPo
|
||||
return result;
|
||||
}
|
||||
|
||||
// Issue new movement command
|
||||
_bot->GetMotionMaster()->MovePoint(0, targetPos.GetPositionX(), targetPos.GetPositionY(), targetPos.GetPositionZ());
|
||||
// Issue new movement command with validated pathfinding
|
||||
if (BotAI* ai = GetBotAI(_bot))
|
||||
{
|
||||
if (!ai->MoveTo(targetPos, true))
|
||||
{
|
||||
// Fallback to legacy if validation fails
|
||||
_bot->GetMotionMaster()->MovePoint(0, targetPos.GetPositionX(), targetPos.GetPositionY(), targetPos.GetPositionZ());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Non-bot player - use standard movement
|
||||
_bot->GetMotionMaster()->MovePoint(0, targetPos.GetPositionX(), targetPos.GetPositionY(), targetPos.GetPositionZ());
|
||||
}
|
||||
|
||||
// FIX #5: SPEED CONTROL SYSTEM - Apply sprint for critical/emergency movement
|
||||
if (result.requiresSprint)
|
||||
|
||||
Reference in New Issue
Block a user