mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-26 03:08:26 +00:00
Move to shared pointer
This commit is contained in:
@@ -189,10 +189,11 @@ void BaseCombatAIComponent::Update(const float deltaTime) {
|
||||
m_StartPosition = m_OwningEntity->GetPosition();
|
||||
}
|
||||
|
||||
m_MovementAI = m_OwningEntity->GetComponent<MovementAIComponent>();
|
||||
|
||||
if (m_MovementAI == nullptr) {
|
||||
return;
|
||||
m_MovementAI = m_OwningEntity->GetComponent<MovementAIComponent>();
|
||||
if (m_MovementAI == nullptr) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (stunnedThisFrame) {
|
||||
@@ -243,7 +244,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
||||
bool hadRemainingDowntime = m_SkillTime > 0.0f;
|
||||
if (m_SkillTime > 0.0f) m_SkillTime -= deltaTime;
|
||||
|
||||
auto* rebuild = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
auto rebuild = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuild != nullptr) {
|
||||
const auto state = rebuild->GetState();
|
||||
@@ -253,7 +254,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
auto* skillComponent = m_OwningEntity->GetComponent<SkillComponent>();
|
||||
auto skillComponent = m_OwningEntity->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
return;
|
||||
@@ -287,7 +288,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
||||
}
|
||||
|
||||
if (!m_TetherEffectActive && m_OutOfCombat && (m_OutOfCombatTime -= deltaTime) <= 0) {
|
||||
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent != nullptr && destroyableComponent->HasFaction(4)) {
|
||||
auto serilizationRequired = false;
|
||||
@@ -547,13 +548,13 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto* referenceDestroyable = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
auto referenceDestroyable = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (referenceDestroyable == nullptr) {
|
||||
Game::logger->Log("BaseCombatAIComponent", "Invalid reference destroyable component on (%llu)!", m_OwningEntity->GetObjectID());
|
||||
@@ -561,7 +562,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto* quickbuild = entity->GetComponent<RebuildComponent>();
|
||||
auto quickbuild = entity->GetComponent<RebuildComponent>();
|
||||
|
||||
if (quickbuild != nullptr) {
|
||||
const auto state = quickbuild->GetState();
|
||||
|
||||
Reference in New Issue
Block a user