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

@@ -3,7 +3,7 @@
void BuccaneerValiantShip::OnStartup(Entity* self) {
self->AddCallbackTimer(1.0F, [self]() {
auto* skillComponent = self->GetComponent<SkillComponent>();
auto skillComponent = self->GetComponent<SkillComponent>();
auto* owner = self->GetOwner();
if (skillComponent != nullptr && owner != nullptr) {

View File

@@ -10,13 +10,13 @@ void PersonalFortress::OnStartup(Entity* self) {
auto* owner = self->GetOwner();
self->AddTimer("FireSkill", 1.5);
auto* destroyableComponent = owner->GetComponent<DestroyableComponent>();
auto destroyableComponent = owner->GetComponent<DestroyableComponent>();
if (destroyableComponent) destroyableComponent->SetStatusImmunity(
eStateChangeType::PUSH,
true, true, true, true, true, false, true, false, false
);
auto* controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
auto controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent) controllablePhysicsComponent->SetStunImmunity(
eStateChangeType::PUSH, LWOOBJID_EMPTY,
true, true, true, true, true, true
@@ -31,13 +31,13 @@ void PersonalFortress::OnStartup(Entity* self) {
void PersonalFortress::OnDie(Entity* self, Entity* killer) {
auto* owner = self->GetOwner();
auto* destroyableComponent = owner->GetComponent<DestroyableComponent>();
auto destroyableComponent = owner->GetComponent<DestroyableComponent>();
if (destroyableComponent) destroyableComponent->SetStatusImmunity(
eStateChangeType::POP,
true, true, true, true, true, false, true, false, false
);
auto* controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
auto controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent) controllablePhysicsComponent->SetStunImmunity(
eStateChangeType::POP, LWOOBJID_EMPTY,
true, true, true, true, true, true
@@ -52,7 +52,7 @@ void PersonalFortress::OnDie(Entity* self, Entity* killer) {
void PersonalFortress::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "FireSkill") {
auto* skillComponent = self->GetComponent<SkillComponent>();
auto skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent) skillComponent->CalculateBehavior(650, 13364, LWOOBJID_EMPTY, true, false);
}
}

View File

@@ -4,14 +4,14 @@
#include "eStateChangeType.h"
void StunImmunity::OnStartup(Entity* self) {
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
if (destroyableComponent) {
destroyableComponent->SetStatusImmunity(
eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true
);
}
auto* controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
auto controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent) {
controllablePhysicsComponent->SetStunImmunity(
eStateChangeType::PUSH, self->GetObjectID(), true