Move to shared pointer

This commit is contained in:
David Markowitz
2023-06-07 00:23:50 -07:00
parent ea9d0d8592
commit 9e9e4dc087
219 changed files with 743 additions and 748 deletions

View File

@@ -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);