mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-01-23 20:22:37 +00:00
Move to shared pointer
This commit is contained in:
@@ -22,7 +22,7 @@ MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) :
|
||||
|
||||
m_BaseCombatAI = nullptr;
|
||||
|
||||
m_BaseCombatAI = reinterpret_cast<BaseCombatAIComponent*>(m_OwningEntity->GetComponent(eReplicaComponentType::BASE_COMBAT_AI));
|
||||
m_BaseCombatAI = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
||||
|
||||
//Try and fix the insane values:
|
||||
if (m_Info.wanderRadius > 5.0f) m_Info.wanderRadius = m_Info.wanderRadius * 0.5f;
|
||||
@@ -322,7 +322,7 @@ foundComponent:
|
||||
}
|
||||
|
||||
void MovementAIComponent::SetPosition(const NiPoint3& value) {
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
|
||||
if (controllablePhysicsComponent != nullptr) {
|
||||
controllablePhysicsComponent->SetPosition(value);
|
||||
@@ -330,7 +330,7 @@ void MovementAIComponent::SetPosition(const NiPoint3& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
|
||||
if (simplePhysicsComponent != nullptr) {
|
||||
simplePhysicsComponent->SetPosition(value);
|
||||
@@ -342,7 +342,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
|
||||
if (controllablePhysicsComponent != nullptr) {
|
||||
controllablePhysicsComponent->SetRotation(value);
|
||||
@@ -350,7 +350,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
|
||||
if (simplePhysicsComponent != nullptr) {
|
||||
simplePhysicsComponent->SetRotation(value);
|
||||
@@ -358,7 +358,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
||||
}
|
||||
|
||||
void MovementAIComponent::SetVelocity(const NiPoint3& value) {
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
|
||||
if (controllablePhysicsComponent != nullptr) {
|
||||
controllablePhysicsComponent->SetVelocity(value);
|
||||
@@ -366,7 +366,7 @@ void MovementAIComponent::SetVelocity(const NiPoint3& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
|
||||
if (simplePhysicsComponent != nullptr) {
|
||||
simplePhysicsComponent->SetVelocity(value);
|
||||
|
||||
Reference in New Issue
Block a user