Replace all auto with auto*

For components
This commit is contained in:
David Markowitz
2023-06-09 01:27:05 -07:00
parent 62aa863997
commit e2dfa1809d
233 changed files with 753 additions and 753 deletions

View File

@@ -24,7 +24,7 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
if (en->GetObjectID() == attacker->GetObjectID()) {
if (Vector3::DistanceSquared(en->GetPosition(), self->GetPosition()) > 10 * 10) continue;
auto destroyable = en->GetComponent<DestroyableComponent>();
auto* destroyable = en->GetComponent<DestroyableComponent>();
if (destroyable == nullptr) {
continue;
}
@@ -40,7 +40,7 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(self, u"camshake", self->GetObjectID(), 16);
auto skillComponent = self->GetComponent<SkillComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
skillComponent->CalculateBehavior(147, 4721, LWOOBJID_EMPTY, true);
}
@@ -49,7 +49,7 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
auto achievementIDs = self->GetVar<std::u16string>(u"achieveID");
// Progress all scripted missions related to this asset
auto missionComponent = attacker->GetComponent<MissionComponent>();
auto* missionComponent = attacker->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
if (missionID != 0) {
missionComponent->ForceProgressValue(missionID,
@@ -70,7 +70,7 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
}
void ExplodingAsset::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
auto destuctableComponent = entering->GetComponent<DestroyableComponent>();
auto* destuctableComponent = entering->GetComponent<DestroyableComponent>();
if (destuctableComponent == nullptr) return;

View File

@@ -4,7 +4,7 @@
#include "ePhysicsEffectType.h"
void ForceVolumeServer::OnStartup(Entity* self) {
auto phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
if (phantomPhysicsComponent == nullptr) return;

View File

@@ -15,7 +15,7 @@ void GrowingFlower::OnSkillEventFired(Entity* self, Entity* target, const std::s
LootGenerator::Instance().DropActivityLoot(target, self, self->GetLOT(), 0);
auto missionComponent = target->GetComponent<MissionComponent>();
auto* missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
for (const auto mission : achievementIDs)
missionComponent->ForceProgressTaskType(mission, static_cast<uint32_t>(eMissionTaskType::SCRIPT), 1);

View File

@@ -12,7 +12,7 @@ void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* cast
if (healMission == 0)
return;
auto missionComponent = caster->GetComponent<MissionComponent>();
auto* missionComponent = caster->GetComponent<MissionComponent>();
if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == eMissionState::ACTIVE) {
missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0,

View File

@@ -4,7 +4,7 @@
void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
const auto flag = self->GetVar<int32_t>(u"RailFlagNum");
auto rebuildComponent = self->GetComponent<RebuildComponent>();
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
// Only allow use if this is not a quick build or the quick build is built
if (rebuildComponent == nullptr || rebuildComponent->GetState() == eRebuildState::COMPLETED) {

View File

@@ -3,7 +3,7 @@
#include "EntityManager.h"
void NjRailPostServer::OnStartup(Entity* self) {
auto rebuildComponent = self->GetComponent<RebuildComponent>();
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr) {
self->SetNetworkVar<bool>(NetworkNotActiveVariable, true);
}

View File

@@ -125,7 +125,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
// If the player doesn't have the flag yet
if (playerFlag != 0 && !player->GetPlayerFlag(playerFlag)) {
auto petComponent = pet->GetComponent<PetComponent>();
auto* petComponent = pet->GetComponent<PetComponent>();
if (petComponent != nullptr) {
// TODO: Pet state = 9 ??
}
@@ -159,7 +159,7 @@ void PetDigServer::HandleBouncerDig(const Entity* self, const Entity* owner) {
* \param owner the owner that just made a pet dig something up
*/
void PetDigServer::ProgressPetDigMissions(const Entity* owner, const Entity* chest) {
auto missionComponent = owner->GetComponent<MissionComponent>();
auto* missionComponent = owner->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
// Can You Dig It progress
@@ -193,7 +193,7 @@ void PetDigServer::ProgressPetDigMissions(const Entity* owner, const Entity* che
void PetDigServer::SpawnPet(Entity* self, const Entity* owner, const DigInfo digInfo) {
// Some treasures require a mission to be active
if (digInfo.requiredMission >= 0) {
auto missionComponent = owner->GetComponent<MissionComponent>();
auto* missionComponent = owner->GetComponent<MissionComponent>();
if (missionComponent != nullptr && missionComponent->GetMissionState(digInfo.requiredMission) < eMissionState::ACTIVE) {
return;
}

View File

@@ -16,7 +16,7 @@ void PropertyDevice::OnRebuildComplete(Entity* self, Entity* target) {
if (propertyOwnerID == std::to_string(LWOOBJID_EMPTY))
return;
auto missionComponent = target->GetComponent<MissionComponent>();
auto* missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
if (missionComponent->GetMissionState(m_PropertyMissionID) == eMissionState::ACTIVE) {
GameMessages::SendPlayFXEffect(self->GetObjectID(), 641, u"create", "callhome");

View File

@@ -4,7 +4,7 @@
#include "MovingPlatformComponent.h"
void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
// auto movingPlatform = self->GetComponent<MovingPlatformComponent>();
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
// if (movingPlatform != nullptr) {
// movingPlatform->StopPathing();
// movingPlatform->SetNoAutoStart(true);
@@ -14,9 +14,9 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
}
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
auto rebuildComponent = self->GetComponent<RebuildComponent>();
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) {
// auto movingPlatform = self->GetComponent<MovingPlatformComponent>();
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
// if (movingPlatform != nullptr) {
// movingPlatform->GotoWaypoint(1);
// }

View File

@@ -7,13 +7,13 @@
#include "CDSkillBehaviorTable.h"
void QbEnemyStunner::OnRebuildComplete(Entity* self, Entity* target) {
auto destroyable = self->GetComponent<DestroyableComponent>();
auto* destroyable = self->GetComponent<DestroyableComponent>();
if (destroyable != nullptr) {
destroyable->SetFaction(115);
}
auto skillComponent = self->GetComponent<SkillComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
if (!skillComponent) return;
// Get the skill IDs of this object.
@@ -51,7 +51,7 @@ void QbEnemyStunner::OnTimerDone(Entity* self, std::string timerName) {
self->AddTimer("DieTime", 5.0f);
} else if (timerName == "TickTime") {
auto skillComponent = self->GetComponent<SkillComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
auto skillBehaviorMap = self->GetVar<std::map<uint32_t, uint32_t>>(u"skillBehaviorMap");

View File

@@ -115,14 +115,14 @@ void QbSpawner::OnChildRemoved(Entity* self, Entity* child) {
}
void QbSpawner::AggroTargetObject(Entity* self, Entity* enemy) {
auto baseCombatAIComponent = enemy->GetComponent<BaseCombatAIComponent>();
auto* baseCombatAIComponent = enemy->GetComponent<BaseCombatAIComponent>();
if (!baseCombatAIComponent) return;
auto gateObjID = self->GetVar<LWOOBJID>(u"gateObj");
if (gateObjID) {
auto* gate = EntityManager::Instance()->GetEntity(gateObjID);
if (gate) {
auto movementAIComponent = enemy->GetComponent<MovementAIComponent>();
auto* movementAIComponent = enemy->GetComponent<MovementAIComponent>();
if (movementAIComponent) movementAIComponent->SetDestination(gate->GetPosition());
baseCombatAIComponent->Taunt(gateObjID, 1000);
}

View File

@@ -9,7 +9,7 @@
//2021-05-03 - max - added script, omitted some parts related to inheritance in lua which we don't need
void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
auto inv = user->GetComponent<InventoryComponent>();
auto* inv = user->GetComponent<InventoryComponent>();
//make sure the user has the required amount of infected bricks
if (inv && inv->GetLotCount(6194) >= bricksToTake) {

View File

@@ -17,7 +17,7 @@ void TouchMissionUpdateServer::OnCollisionPhantom(Entity* self, Entity* target)
return;
}
auto missionComponent = target->GetComponent<MissionComponent>();
auto* missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent == nullptr) {
return;

View File

@@ -9,7 +9,7 @@ void WishingWellServer::OnStartup(Entity* self) {
}
void WishingWellServer::OnUse(Entity* self, Entity* user) {
auto scriptedActivity = self->GetComponent<ScriptedActivityComponent>();
auto* scriptedActivity = self->GetComponent<ScriptedActivityComponent>();
if (!scriptedActivity->TakeCost(user)) {
return;