mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
fix(Core/SAI) Add missing parameters for SMART_ACTION_MOVE_TO_POS (#1813)
* Imported changes from TC Game/AI: Implement ContactDistance for ACTION_MOVE_TO_POS * Contactdistance * We don't have disablePathFinding * Update src/server/game/AI/SmartScripts/SmartScript.cpp Co-Authored-By: Pondaveia <43385840+Pondaveia@users.noreply.github.com> * Update src/server/game/AI/SmartScripts/SmartScript.cpp * Update SmartScriptMgr.h * Update src/server/game/AI/SmartScripts/SmartScript.cpp Co-Authored-By: Stoabrogga <38475780+Stoabrogga@users.noreply.github.com>
This commit is contained in:
@@ -1888,9 +1888,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else // Xinef: we can use dest.x, dest.y, dest.z to make offset :)
|
||||
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
|
||||
|
||||
else // Xinef: we can use dest.x, dest.y, dest.z to make offset
|
||||
{
|
||||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
if (e.action.MoveToPos.ContactDistance > 0)
|
||||
target->GetContactPoint(me, x, y, z, e.action.MoveToPos.ContactDistance);
|
||||
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, x + e.target.x, y + e.target.y, z + e.target.z, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_MOVE_TO_POS_TARGET:
|
||||
|
||||
Reference in New Issue
Block a user