mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
Replace all auto with auto*
For components
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
void BurningTile::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
|
||||
if (args == "PlayerEntered") {
|
||||
auto skillComponent = sender->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = sender->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -68,7 +68,7 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
|
||||
|
||||
self->SetVar<LWOOBJID>(u"Counterweight", counterweight->GetObjectID());
|
||||
|
||||
auto rebuildComponent = counterweight->GetComponent<RebuildComponent>();
|
||||
auto* rebuildComponent = counterweight->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent != nullptr) {
|
||||
rebuildComponent->AddRebuildStateCallback([this, self](eRebuildState state) {
|
||||
|
@@ -7,7 +7,7 @@
|
||||
void EnemySkeletonSpawner::OnStartup(Entity* self) {
|
||||
self->SetProximityRadius(15, "ronin");
|
||||
|
||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent != nullptr) {
|
||||
skillComponent->CalculateBehavior(1127, 24812, LWOOBJID_EMPTY, true);
|
||||
@@ -16,7 +16,7 @@ void EnemySkeletonSpawner::OnStartup(Entity* self) {
|
||||
|
||||
void EnemySkeletonSpawner::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");
|
||||
@@ -48,7 +48,7 @@ void EnemySkeletonSpawner::OnProximityUpdate(Entity* self, Entity* entering, std
|
||||
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);
|
||||
@@ -65,7 +65,7 @@ void EnemySkeletonSpawner::OnHit(Entity* self, Entity* attacker) {
|
||||
void EnemySkeletonSpawner::StartHatching(Entity* self) {
|
||||
self->SetVar(u"hatching", true);
|
||||
|
||||
auto renderComponent = self->GetComponent<RenderComponent>();
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
|
||||
if (renderComponent != nullptr) {
|
||||
renderComponent->PlayEffect(9017, u"cast", "WakeUpFX1");
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "GameMessages.h"
|
||||
|
||||
void FallingTile::OnStartup(Entity* self) {
|
||||
auto movingPlatfromComponent = self->GetComponent<MovingPlatformComponent>();
|
||||
auto* movingPlatfromComponent = self->GetComponent<MovingPlatformComponent>();
|
||||
|
||||
if (movingPlatfromComponent == nullptr) {
|
||||
return;
|
||||
@@ -31,7 +31,7 @@ void FallingTile::OnWaypointReached(Entity* self, uint32_t waypointIndex) {
|
||||
}
|
||||
|
||||
void FallingTile::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto movingPlatfromComponent = self->GetComponent<MovingPlatformComponent>();
|
||||
auto* movingPlatfromComponent = self->GetComponent<MovingPlatformComponent>();
|
||||
|
||||
if (movingPlatfromComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -19,7 +19,7 @@ void FlameJetServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto skillComponent = target->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = target->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
|
||||
// If the rebuild component is complete, use the shrine
|
||||
auto rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "dZoneManager.h"
|
||||
|
||||
void Lieutenant::OnStartup(Entity* self) {
|
||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -8,7 +8,7 @@ void NjColeNPC::OnEmoteReceived(Entity* self, int32_t emote, Entity* target) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
@@ -18,7 +18,7 @@ void NjColeNPC::OnEmoteReceived(Entity* self, int32_t emote, Entity* target) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto missionComponent = target->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent == nullptr) {
|
||||
return;
|
||||
@@ -31,8 +31,8 @@ void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID,
|
||||
NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(self, target, missionID, missionState);
|
||||
|
||||
if (missionID == 1818 && missionState >= eMissionState::READY_TO_COMPLETE) {
|
||||
auto missionComponent = target->GetComponent<MissionComponent>();
|
||||
auto inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||
|
||||
if (missionComponent == nullptr || inventoryComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -12,7 +12,7 @@ void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false);
|
||||
}
|
||||
|
||||
auto destroyable = self->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyable != nullptr) {
|
||||
LootGenerator::Instance().DropLoot(user, self, destroyable->GetLootMatrixID(), 0, 0);
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "PetComponent.h"
|
||||
|
||||
void NjEarthPetServer::OnStartup(Entity* self) {
|
||||
auto petComponent = self->GetComponent<PetComponent>();
|
||||
auto* petComponent = self->GetComponent<PetComponent>();
|
||||
if (petComponent == nullptr || petComponent->GetOwnerId() != LWOOBJID_EMPTY)
|
||||
return;
|
||||
|
||||
|
@@ -5,7 +5,7 @@ void NjScrollChestServer::OnUse(Entity* self, Entity* user) {
|
||||
const auto keyLOT = self->GetVar<LOT>(u"KeyNum");
|
||||
const auto rewardItemLOT = self->GetVar<LOT>(u"openItemID");
|
||||
|
||||
auto playerInventory = user->GetComponent<InventoryComponent>();
|
||||
auto* playerInventory = user->GetComponent<InventoryComponent>();
|
||||
if (playerInventory != nullptr && playerInventory->GetLotCount(keyLOT) == 1) {
|
||||
|
||||
// Check for the key and remove
|
||||
|
@@ -11,7 +11,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
|
||||
// The Dragon statue daily mission
|
||||
if (missionID == m_MainDragonMissionID) {
|
||||
auto* character = target->GetCharacter();
|
||||
auto missionComponent = target->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (character == nullptr || missionComponent == nullptr)
|
||||
return;
|
||||
|
||||
|
@@ -43,7 +43,7 @@ void RainOfArrows::OnTimerDone(Entity* self, std::string timerName) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto skillComponent = child->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = child->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -51,7 +51,7 @@ void NjMonastryBossInstance::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
UpdatePlayer(self, player->GetObjectID());
|
||||
|
||||
// Buff the player
|
||||
auto destroyableComponent = player->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = player->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent != nullptr) {
|
||||
destroyableComponent->SetHealth((int32_t)destroyableComponent->GetMaxHealth());
|
||||
destroyableComponent->SetArmor((int32_t)destroyableComponent->GetMaxArmor());
|
||||
@@ -147,7 +147,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
} else if (timerName + TimerSplitChar == UnstunTimer) {
|
||||
auto* entity = EntityManager::Instance()->GetEntity(objectID);
|
||||
if (entity != nullptr) {
|
||||
auto combatAI = entity->GetComponent<BaseCombatAIComponent>();
|
||||
auto* combatAI = entity->GetComponent<BaseCombatAIComponent>();
|
||||
if (combatAI != nullptr) {
|
||||
combatAI->SetDisabled(false);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ void NjMonastryBossInstance::HandleLedgedFrakjawSpawned(Entity* self, Entity* le
|
||||
}
|
||||
|
||||
void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* counterWeight) {
|
||||
auto rebuildComponent = counterWeight->GetComponent<RebuildComponent>();
|
||||
auto* rebuildComponent = counterWeight->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr) {
|
||||
rebuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) {
|
||||
|
||||
@@ -257,7 +257,7 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
|
||||
return;
|
||||
}
|
||||
|
||||
auto skillComponent = frakjaw->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = frakjaw->GetComponent<SkillComponent>();
|
||||
if (skillComponent != nullptr) {
|
||||
skillComponent->CalculateBehavior(1635, 39097, frakjaw->GetObjectID(), true, false);
|
||||
}
|
||||
@@ -285,12 +285,12 @@ void NjMonastryBossInstance::HandleLowerFrakjawSpawned(Entity* self, Entity* low
|
||||
RenderComponent::PlayAnimation(lowerFrakjaw, TeleportInAnimation);
|
||||
self->SetVar<LWOOBJID>(LowerFrakjawVariable, lowerFrakjaw->GetObjectID());
|
||||
|
||||
auto combatAI = lowerFrakjaw->GetComponent<BaseCombatAIComponent>();
|
||||
auto* combatAI = lowerFrakjaw->GetComponent<BaseCombatAIComponent>();
|
||||
if (combatAI != nullptr) {
|
||||
combatAI->SetDisabled(true);
|
||||
}
|
||||
|
||||
auto destroyableComponent = lowerFrakjaw->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = lowerFrakjaw->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent != nullptr) {
|
||||
destroyableComponent->AddOnHitCallback([this, self, lowerFrakjaw](Entity* attacker) {
|
||||
NjMonastryBossInstance::HandleLowerFrakjawHit(self, lowerFrakjaw, attacker);
|
||||
@@ -323,7 +323,7 @@ void NjMonastryBossInstance::HandleLowerFrakjawSpawned(Entity* self, Entity* low
|
||||
}
|
||||
|
||||
void NjMonastryBossInstance::HandleLowerFrakjawHit(Entity* self, Entity* lowerFrakjaw, Entity* attacker) {
|
||||
auto destroyableComponent = lowerFrakjaw->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = lowerFrakjaw->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent == nullptr)
|
||||
return;
|
||||
|
||||
@@ -332,7 +332,7 @@ void NjMonastryBossInstance::HandleLowerFrakjawHit(Entity* self, Entity* lowerFr
|
||||
self->SetVar<bool>(OnLastWaveVarbiale, true);
|
||||
|
||||
// Stun frakjaw during the cinematic
|
||||
auto combatAI = lowerFrakjaw->GetComponent<BaseCombatAIComponent>();
|
||||
auto* combatAI = lowerFrakjaw->GetComponent<BaseCombatAIComponent>();
|
||||
if (combatAI != nullptr) {
|
||||
combatAI->SetDisabled(true);
|
||||
}
|
||||
@@ -347,7 +347,7 @@ void NjMonastryBossInstance::HandleLowerFrakjawHit(Entity* self, Entity* lowerFr
|
||||
newTrashMobs.push_back(trashMobID);
|
||||
|
||||
// Stun all the enemies until the cinematic is over
|
||||
auto trashMobCombatAI = trashMob->GetComponent<BaseCombatAIComponent>();
|
||||
auto* trashMobCombatAI = trashMob->GetComponent<BaseCombatAIComponent>();
|
||||
if (trashMobCombatAI != nullptr) {
|
||||
trashMobCombatAI->SetDisabled(true);
|
||||
}
|
||||
@@ -375,7 +375,7 @@ void NjMonastryBossInstance::HandleWaveEnemySpawned(Entity* self, Entity* waveEn
|
||||
waveEnemies.push_back(waveEnemy->GetObjectID());
|
||||
self->SetVar<std::vector<LWOOBJID>>(TrashMobsAliveVariable, waveEnemies);
|
||||
|
||||
auto combatAI = waveEnemy->GetComponent<BaseCombatAIComponent>();
|
||||
auto* combatAI = waveEnemy->GetComponent<BaseCombatAIComponent>();
|
||||
if (combatAI != nullptr) {
|
||||
combatAI->SetDisabled(true);
|
||||
ActivityTimerStart(self, UnstunTimer + std::to_string(waveEnemy->GetObjectID()), 3.0f, 3.0f);
|
||||
@@ -436,7 +436,7 @@ void NjMonastryBossInstance::RemovePoison(Entity* self) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
|
||||
auto buffComponent = player->GetComponent<BuffComponent>();
|
||||
auto* buffComponent = player->GetComponent<BuffComponent>();
|
||||
if (buffComponent != nullptr) {
|
||||
buffComponent->RemoveBuff(PoisonBuff);
|
||||
}
|
||||
|
Reference in New Issue
Block a user