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

@@ -10,7 +10,7 @@ void EnemyRoninSpawner::OnStartup(Entity* self) {
void EnemyRoninSpawner::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "hatchTime") {
auto* renderComponent = self->GetComponent<RenderComponent>();
auto renderComponent = self->GetComponent<RenderComponent>();
if (renderComponent != nullptr) {
renderComponent->PlayEffect(644, u"create", "BurstFX1");
@@ -42,7 +42,7 @@ void EnemyRoninSpawner::OnProximityUpdate(Entity* self, Entity* entering, std::s
if (entering->IsPlayer() && name == "ronin" && status == "ENTER" && !self->GetVar<bool>(u"hatching")) {
StartHatching(self);
auto* skillComponent = self->GetComponent<SkillComponent>();
auto skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
skillComponent->CalculateBehavior(305, 3568, LWOOBJID_EMPTY);
@@ -59,7 +59,7 @@ void EnemyRoninSpawner::OnHit(Entity* self, Entity* attacker) {
void EnemyRoninSpawner::StartHatching(Entity* self) {
self->SetVar(u"hatching", true);
auto* renderComponent = self->GetComponent<RenderComponent>();
auto renderComponent = self->GetComponent<RenderComponent>();
if (renderComponent != nullptr) {
renderComponent->PlayEffect(2260, u"rebuild_medium", "WakeUpFX1");

View File

@@ -6,7 +6,7 @@
std::vector<int32_t> FvCandle::m_Missions = { 850, 1431, 1529, 1566, 1603 };
void FvCandle::OnStartup(Entity* self) {
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
auto render = self->GetComponent<RenderComponent>();
if (render == nullptr)
return;
@@ -23,11 +23,11 @@ void FvCandle::BlowOutCandle(Entity* self, Entity* blower) {
if (self->GetBoolean(u"AmHit"))
return;
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
auto render = self->GetComponent<RenderComponent>();
if (render == nullptr)
return;
auto* missionComponent = blower->GetComponent<MissionComponent>();
auto missionComponent = blower->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
for (const auto mission : m_Missions) {
@@ -47,7 +47,7 @@ void FvCandle::BlowOutCandle(Entity* self, Entity* blower) {
void FvCandle::OnTimerDone(Entity* self, std::string timerName) {
self->SetBoolean(u"AmHit", false);
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
auto render = self->GetComponent<RenderComponent>();
if (render == nullptr)
return;

View File

@@ -39,7 +39,7 @@ FvHorsemenTrigger::OnFireEventServerSide(Entity* self, Entity* sender, std::stri
continue;
}
auto* missionComponent = player->GetComponent<MissionComponent>();
auto missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent == nullptr) {
continue;

View File

@@ -19,7 +19,7 @@ void ImgBrickConsoleQB::OnStartup(Entity* self) {
}
void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
if (!self->GetNetworkVar<bool>(u"used")) {
@@ -28,7 +28,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
auto bothBuilt = false;
for (auto* console : consoles) {
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
auto consoleRebuildComponent = console->GetComponent<RebuildComponent>();
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
continue;
@@ -69,8 +69,8 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
auto* player = user;
auto* missionComponent = player->GetComponent<MissionComponent>();
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
auto missionComponent = player->GetComponent<MissionComponent>();
auto inventoryComponent = player->GetComponent<InventoryComponent>();
if (missionComponent != nullptr && inventoryComponent != nullptr) {
if (missionComponent->GetMissionState(1302) == eMissionState::ACTIVE) {
@@ -145,7 +145,7 @@ void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
for (auto* console : consoles) {
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
auto consoleRebuildComponent = console->GetComponent<RebuildComponent>();
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
continue;
@@ -166,7 +166,7 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
self->SetVar(u"Died", true);
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
auto offFX = 0;
@@ -227,7 +227,7 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "reset") {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::OPEN) {
self->Smash(self->GetObjectID(), eKillType::SILENT);

View File

@@ -23,7 +23,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
return;
}
auto* possessableComponent = entering->GetComponent<PossessableComponent>();
auto possessableComponent = entering->GetComponent<PossessableComponent>();
Entity* vehicle;
Entity* player;
@@ -37,7 +37,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
vehicle = entering;
} else if (entering->IsPlayer()) {
auto* possessorComponent = entering->GetComponent<PossessorComponent>();
auto possessorComponent = entering->GetComponent<PossessorComponent>();
if (possessorComponent == nullptr) {
return;
@@ -59,7 +59,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
auto racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
if (racingControlComponent != nullptr) {
racingControlComponent->OnRequestDie(player);