mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
chore: Small movementAiComponent cleanup (#1145)
* rename and cleanup file * more * fix broken function * Further naming fixes t Revert "Further naming fixes" This reverts commit 057189982ba56788d48f9265d815e6c562ba6328. * next step * undo all testing changes * minor tweaks
This commit is contained in:
@@ -395,7 +395,7 @@ void PetComponent::Update(float deltaTime) {
|
||||
}
|
||||
|
||||
auto destination = owner->GetPosition();
|
||||
NiPoint3 position = m_MovementAI->GetCurrentPosition();
|
||||
NiPoint3 position = m_MovementAI->GetParent()->GetPosition();
|
||||
|
||||
float distanceToOwner = Vector3::DistanceSquared(position, destination);
|
||||
|
||||
@@ -466,7 +466,7 @@ skipTresure:
|
||||
|
||||
m_MovementAI->SetHaltDistance(haltDistance);
|
||||
|
||||
m_MovementAI->SetSpeed(2.5f);
|
||||
m_MovementAI->SetMaxSpeed(2.5f);
|
||||
|
||||
m_MovementAI->SetDestination(destination);
|
||||
|
||||
@@ -822,17 +822,17 @@ void PetComponent::Wander() {
|
||||
destination.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(destination);
|
||||
}
|
||||
|
||||
if (Vector3::DistanceSquared(destination, m_MovementAI->GetCurrentPosition()) < 2 * 2) {
|
||||
if (Vector3::DistanceSquared(destination, m_MovementAI->GetParent()->GetPosition()) < 2 * 2) {
|
||||
m_MovementAI->Stop();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_MovementAI->SetSpeed(info.wanderSpeed);
|
||||
m_MovementAI->SetMaxSpeed(info.wanderSpeed);
|
||||
|
||||
m_MovementAI->SetDestination(destination);
|
||||
|
||||
m_Timer += (m_MovementAI->GetCurrentPosition().x - destination.x) / info.wanderSpeed;
|
||||
m_Timer += (m_MovementAI->GetParent()->GetPosition().x - destination.x) / info.wanderSpeed;
|
||||
}
|
||||
|
||||
void PetComponent::Activate(Item* item, bool registerPet, bool fromTaming) {
|
||||
|
Reference in New Issue
Block a user