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

@@ -19,7 +19,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
continue;
}
auto* rebuildComponent = object->GetComponent<RebuildComponent>();
auto rebuildComponent = object->GetComponent<RebuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
indexCount++;
@@ -37,7 +37,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
auto* player = EntityManager::Instance()->GetEntity(object->GetVar<LWOOBJID>(u"PlayerID"));
if (player != nullptr) {
auto* missionComponent = player->GetComponent<MissionComponent>();
auto missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
missionComponent->ForceProgressTaskType(769, 1, 1, false);

View File

@@ -59,7 +59,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "reset") {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::OPEN) {
self->Smash(self->GetObjectID(), eKillType::SILENT);

View File

@@ -40,7 +40,7 @@ void FvFlyingCreviceDragon::OnTimerDone(Entity* self, std::string timerName) {
return;
}
auto* skillComponent = group[0]->GetComponent<SkillComponent>();
auto skillComponent = group[0]->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
skillComponent->CalculateBehavior(762, 12506, LWOOBJID_EMPTY, true);
@@ -79,7 +79,7 @@ void FvFlyingCreviceDragon::OnArrived(Entity* self) {
return;
}
auto* skillComponent = group2[0]->GetComponent<SkillComponent>();
auto skillComponent = group2[0]->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
skillComponent->CalculateBehavior(762, 12506, LWOOBJID_EMPTY);

View File

@@ -5,7 +5,7 @@
void FvFreeGfNinjas::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID == 705 && missionState == eMissionState::AVAILABLE) {
auto* missionComponent = target->GetComponent<MissionComponent>();
auto missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent == nullptr)
return;
@@ -26,7 +26,7 @@ void FvFreeGfNinjas::OnMissionDialogueOK(Entity* self, Entity* target, int missi
void FvFreeGfNinjas::OnUse(Entity* self, Entity* user) {
// To allow player who already have the mission to progress.
auto* missionComponent = user->GetComponent<MissionComponent>();
auto missionComponent = user->GetComponent<MissionComponent>();
if (missionComponent == nullptr)
return;

View File

@@ -8,7 +8,7 @@ void FvMaelstromGeyser::OnStartup(Entity* self) {
void FvMaelstromGeyser::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == m_StartSkillTimerName) {
auto* skillComponent = self->GetComponent<SkillComponent>();
auto skillComponent = self->GetComponent<SkillComponent>();
skillComponent->CalculateBehavior(m_SkillID, m_BehaviorID, LWOOBJID_EMPTY, true);
}
if (timerName == m_KillSelfTimerName) {

View File

@@ -4,7 +4,7 @@
#include "ePetTamingNotifyType.h"
void FvPandaServer::OnStartup(Entity* self) {
const auto* petComponent = self->GetComponent<PetComponent>();
const auto petComponent = self->GetComponent<PetComponent>();
if (petComponent != nullptr && petComponent->GetOwner() == nullptr) {
self->SetNetworkVar<std::string>(u"pandatamer", std::to_string(self->GetVar<LWOOBJID>(u"tamer")));
self->AddTimer("killSelf", 45);
@@ -28,7 +28,7 @@ void FvPandaServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetT
void FvPandaServer::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "killSelf") {
const auto* petComponent = self->GetComponent<PetComponent>();
const auto petComponent = self->GetComponent<PetComponent>();
if (petComponent != nullptr && petComponent->GetOwner() == nullptr) {
self->Smash(self->GetObjectID(), eKillType::SILENT);
}

View File

@@ -14,7 +14,7 @@ void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {
return;
// Check if the player is currently in a footrace
auto* scriptedActivityComponent = raceObjects.at(0)->GetComponent<ScriptedActivityComponent>();
auto scriptedActivityComponent = raceObjects.at(0)->GetComponent<ScriptedActivityComponent>();
if (scriptedActivityComponent == nullptr || !scriptedActivityComponent->IsPlayedBy(target))
return;

View File

@@ -36,7 +36,7 @@ void TriggerGas::OnTimerDone(Entity* self, std::string timerName) {
auto inventoryComponent = player->GetComponent<InventoryComponent>();
if (inventoryComponent) {
if (!inventoryComponent->IsEquipped(this->m_MaelstromHelmet)) {
auto* skillComponent = self->GetComponent<SkillComponent>();
auto skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent) {
skillComponent->CastSkill(this->m_FogDamageSkill, player->GetObjectID());
}