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

@@ -72,7 +72,7 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
if (activePlayer != nullptr && name == "checkPlayer" && self->GetVar<bool>(u"beingPlayed")) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"checkMovement", 0, 0,
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
auto stats = activePlayer->GetComponent<DestroyableComponent>();
auto* stats = activePlayer->GetComponent<DestroyableComponent>();
if (stats) {
if (stats->GetImagination() > 0) {
self->AddTimer("checkPlayer", updateFrequency);
@@ -81,7 +81,7 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
}
}
} else if (activePlayer != nullptr && name == "deductImagination" && self->GetVar<bool>(u"beingPlayed")) {
auto stats = activePlayer->GetComponent<DestroyableComponent>();
auto* stats = activePlayer->GetComponent<DestroyableComponent>();
if (stats)
stats->SetImagination(stats->GetImagination() - instrumentImaginationCost);
@@ -93,20 +93,20 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
}
auto rebuildComponent = self->GetComponent<RebuildComponent>();
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr)
rebuildComponent->ResetRebuild(false);
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
} else if (activePlayer != nullptr && name == "achievement") {
auto missionComponent = activePlayer->GetComponent<MissionComponent>();
auto* missionComponent = activePlayer->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
missionComponent->ForceProgress(302, 462, self->GetLOT());
}
self->AddTimer("achievement2", 10.0f);
} else if (activePlayer != nullptr && name == "achievement2") {
auto missionComponent = activePlayer->GetComponent<MissionComponent>();
auto* missionComponent = activePlayer->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
missionComponent->ForceProgress(602, achievementTaskID.at(GetInstrumentLot(self)), self->GetLOT());
}
@@ -127,7 +127,7 @@ void NsConcertInstrument::StartPlayingInstrument(Entity* self, Entity* player) {
});
for (auto* soundBox : EntityManager::Instance()->GetEntitiesInGroup("Audio-Concert")) {
auto soundTrigger = soundBox->GetComponent<SoundTriggerComponent>();
auto* soundTrigger = soundBox->GetComponent<SoundTriggerComponent>();
if (soundTrigger != nullptr) {
soundTrigger->ActivateMusicCue(music.at(instrumentLot));
}
@@ -148,7 +148,7 @@ void NsConcertInstrument::StopPlayingInstrument(Entity* self, Entity* player) {
// Player might be null if they left
if (player != nullptr) {
auto missions = player->GetComponent<MissionComponent>();
auto* missions = player->GetComponent<MissionComponent>();
if (missions != nullptr && missions->GetMissionState(176) == eMissionState::ACTIVE) {
missions->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
}
@@ -162,7 +162,7 @@ void NsConcertInstrument::StopPlayingInstrument(Entity* self, Entity* player) {
self->SetVar<bool>(u"beingPlayed", false);
for (auto* soundBox : EntityManager::Instance()->GetEntitiesInGroup("Audio-Concert")) {
auto soundTrigger = soundBox->GetComponent<SoundTriggerComponent>();
auto* soundTrigger = soundBox->GetComponent<SoundTriggerComponent>();
if (soundTrigger != nullptr) {
soundTrigger->DeactivateMusicCue(music.at(instrumentLot));
}
@@ -173,7 +173,7 @@ void NsConcertInstrument::StopPlayingInstrument(Entity* self, Entity* player) {
}
void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) {
auto inventory = player->GetComponent<InventoryComponent>();
auto* inventory = player->GetComponent<InventoryComponent>();
if (inventory != nullptr) {
auto equippedItems = inventory->GetEquippedItems();
@@ -216,7 +216,7 @@ void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) {
}
void NsConcertInstrument::UnEquipInstruments(Entity* self, Entity* player) {
auto inventory = player->GetComponent<InventoryComponent>();
auto* inventory = player->GetComponent<InventoryComponent>();
if (inventory != nullptr) {
auto equippedItems = inventory->GetEquippedItems();

View File

@@ -103,7 +103,7 @@ void NsConcertQuickBuild::OnRebuildComplete(Entity* self, Entity* target) {
// Move all the platforms so the user can collect the imagination brick
const auto movingPlatforms = EntityManager::Instance()->GetEntitiesInGroup("ConcertPlatforms");
for (auto* movingPlatform : movingPlatforms) {
auto component = movingPlatform->GetComponent<MovingPlatformComponent>();
auto* component = movingPlatform->GetComponent<MovingPlatformComponent>();
if (component) {
component->WarpToWaypoint(component->GetLastWaypointIndex());
@@ -132,7 +132,7 @@ void NsConcertQuickBuild::OnRebuildComplete(Entity* self, Entity* target) {
quickBuild->Smash();
});
auto destroyableComponent = quickBuild->GetComponent<DestroyableComponent>();
auto* destroyableComponent = quickBuild->GetComponent<DestroyableComponent>();
if (destroyableComponent)
destroyableComponent->SetFaction(-1);
}
@@ -157,7 +157,7 @@ void NsConcertQuickBuild::OnRebuildComplete(Entity* self, Entity* target) {
}
void NsConcertQuickBuild::ProgressStageCraft(Entity* self, Entity* player) {
auto missionComponent = player->GetComponent<MissionComponent>();
auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent) {
// Has to be forced as to not accidentally trigger the licensed technician achievement
@@ -186,7 +186,7 @@ void NsConcertQuickBuild::ProgressLicensedTechnician(Entity* self) {
if (playerID != LWOOBJID_EMPTY) {
const auto player = EntityManager::Instance()->GetEntity(playerID);
if (player) {
auto playerMissionComponent = player->GetComponent<MissionComponent>();
auto* playerMissionComponent = player->GetComponent<MissionComponent>();
if (playerMissionComponent)
playerMissionComponent->ForceProgress(598, 903, self->GetLOT());
}

View File

@@ -46,7 +46,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
player->GetCharacter()->SetPlayerFlag(flagID, true);
}
auto mis = player->GetComponent<MissionComponent>();
auto* mis = player->GetComponent<MissionComponent>();
for (int mission : factionMissions) {
mis->AcceptMission(mission);

View File

@@ -4,7 +4,7 @@
void NsJohnnyMissionServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID == 773 && missionState <= eMissionState::ACTIVE) {
auto missionComponent = target->GetComponent<MissionComponent>();
auto* missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
missionComponent->AcceptMission(774);
missionComponent->AcceptMission(775);

View File

@@ -5,7 +5,7 @@
void NsModularBuild::OnModularBuildExit(Entity* self, Entity* player, bool bCompleted, std::vector<LOT> modules) {
if (bCompleted) {
auto mission = self->GetComponent<MissionComponent>();
auto* mission = self->GetComponent<MissionComponent>();
if (mission->GetMissionState(m_MissionNum) == eMissionState::ACTIVE) {
for (LOT mod : modules) {

View File

@@ -25,7 +25,7 @@ void WhFans::ToggleFX(Entity* self, bool hit) {
std::vector<Entity*> fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup);
auto renderComponent = self->GetComponent<RenderComponent>();
auto* renderComponent = self->GetComponent<RenderComponent>();
if (renderComponent == nullptr) return;
@@ -38,7 +38,7 @@ void WhFans::ToggleFX(Entity* self, bool hit) {
self->SetVar<bool>(u"on", false);
for (Entity* volume : fanVolumes) {
auto volumePhys = volume->GetComponent<PhantomPhysicsComponent>();
auto* volumePhys = volume->GetComponent<PhantomPhysicsComponent>();
if (!volumePhys) continue;
volumePhys->SetPhysicsEffectActive(false);
EntityManager::Instance()->SerializeEntity(volume);
@@ -49,7 +49,7 @@ void WhFans::ToggleFX(Entity* self, bool hit) {
self->SetVar<bool>(u"on", true);
for (Entity* volume : fanVolumes) {
auto volumePhys = volume->GetComponent<PhantomPhysicsComponent>();
auto* volumePhys = volume->GetComponent<PhantomPhysicsComponent>();
if (!volumePhys) continue;
volumePhys->SetPhysicsEffectActive(true);
EntityManager::Instance()->SerializeEntity(volume);