Fix: prevent MoveSplineInitArgs::Validate velocity asserts (velocity > 0.01f) for bots, pets, and charmed units (#1534)

* MoveSplineInitArgs::Validate: expression 'velocity > 0.01f' failed for GUID Full

* Update BotMovementUtils.h
This commit is contained in:
Alex Dcnh
2025-08-12 01:53:48 +02:00
committed by GitHub
parent c6b0424c29
commit 4e3ac609bd
6 changed files with 111 additions and 3 deletions

View File

@@ -9,6 +9,7 @@
#include "LastMovementValue.h"
#include "Playerbots.h"
#include "Transport.h"
#include "BotMovementUtils.h"
bool ReachAreaTriggerAction::Execute(Event event)
{
@@ -40,7 +41,18 @@ bool ReachAreaTriggerAction::Execute(Event event)
return true;
}
bot->GetMotionMaster()->MovePoint(at->map, at->x, at->y, at->z);
// bot->GetMotionMaster()->MovePoint(at->map, at->x, at->y, at->z);
// [Fix: MoveSplineInitArgs::Validate: expression 'velocity > 0.01f' failed for GUID Full:]
if (CanStartMoveSpline(bot))
{
bot->GetMotionMaster()->MovePoint(at->map, at->x, at->y, at->z);
}
else
{
bot->StopMovingOnCurrentPos();
botAI->SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
return false;
}
float distance = bot->GetDistance(at->x, at->y, at->z);
float delay = 1000.0f * distance / bot->GetSpeed(MOVE_RUN) + sPlayerbotAIConfig->reactDelay;