mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
Bunch of refactoring and walking, AI needs a ton of tweaking to use the new logic
This commit is contained in:
+19
-3
@@ -427,7 +427,7 @@ void NPC::SaveGuardSpot(bool iClearGuardSpot) {
|
||||
}
|
||||
|
||||
void NPC::NextGuardPosition() {
|
||||
NavigateTo(m_GuardPoint.x, m_GuardPoint.y, m_GuardPoint.z, GetMovespeed());
|
||||
NavigateTo(m_GuardPoint.x, m_GuardPoint.y, m_GuardPoint.z);
|
||||
if ((m_Position.x == m_GuardPoint.x) && (m_Position.y == m_GuardPoint.y) && (m_Position.z == m_GuardPoint.z))
|
||||
{
|
||||
if (moved)
|
||||
@@ -442,8 +442,24 @@ float Mob::CalculateDistance(float x, float y, float z) {
|
||||
return (float)sqrtf(((m_Position.x - x)*(m_Position.x - x)) + ((m_Position.y - y)*(m_Position.y - y)) + ((m_Position.z - z)*(m_Position.z - z)));
|
||||
}
|
||||
|
||||
void Mob::NavigateTo(float x, float y, float z, float speed) {
|
||||
mMovementManager->NavigateTo(this, x, y, z, speed);
|
||||
void Mob::WalkTo(float x, float y, float z)
|
||||
{
|
||||
mMovementManager->NavigateTo(this, x, y, z, false, MovementWalking);
|
||||
}
|
||||
|
||||
void Mob::RunTo(float x, float y, float z)
|
||||
{
|
||||
mMovementManager->NavigateTo(this, x, y, z, false, MovementRunning);
|
||||
}
|
||||
|
||||
void Mob::NavigateTo(float x, float y, float z)
|
||||
{
|
||||
if (IsRunning()) {
|
||||
mMovementManager->NavigateTo(this, x, y, z, false, MovementRunning);
|
||||
}
|
||||
else {
|
||||
mMovementManager->NavigateTo(this, x, y, z, false, MovementWalking);
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::StopNavigation() {
|
||||
|
||||
Reference in New Issue
Block a user