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

@@ -31,11 +31,11 @@ void BaseEnemyApe::OnSkillCast(Entity* self, uint32_t skillID) {
}
void BaseEnemyApe::OnHit(Entity* self, Entity* attacker) {
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
if (destroyableComponent != nullptr && destroyableComponent->GetArmor() < 1 && !self->GetBoolean(u"knockedOut")) {
StunApe(self, true);
self->CancelTimer("spawnQBTime");
auto skillComponent = self->GetComponent<SkillComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent) {
skillComponent->Reset();
}
@@ -52,7 +52,7 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
// Revives the ape, giving it back some armor
const auto timesStunned = self->GetVar<uint32_t>(u"timesStunned");
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
if (destroyableComponent != nullptr) {
destroyableComponent->SetArmor(destroyableComponent->GetMaxArmor() / timesStunned);
}
@@ -104,7 +104,7 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
return;
}
auto skillComponent = self->GetComponent<SkillComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
skillComponent->CalculateBehavior(1273, 29446, self->GetObjectID(), true, false, player->GetObjectID());
}
@@ -123,12 +123,12 @@ void BaseEnemyApe::OnFireEventServerSide(Entity* self, Entity* sender, std::stri
}
void BaseEnemyApe::StunApe(Entity* self, bool stunState) {
auto combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
if (combatAIComponent != nullptr) {
combatAIComponent->SetDisabled(stunState);
combatAIComponent->SetStunned(stunState);
auto skillComponent = self->GetComponent<SkillComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
skillComponent->Interrupt();
}

View File

@@ -9,14 +9,14 @@
#include "eReplicaComponentType.h"
void BaseEnemyMech::OnStartup(Entity* self) {
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
if (destroyableComponent != nullptr) {
destroyableComponent->SetFaction(4);
}
}
void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
auto controlPhys = self->GetComponent<ControllablePhysicsComponent>();
auto* controlPhys = self->GetComponent<ControllablePhysicsComponent>();
if (!controlPhys) return;
NiPoint3 newLoc = { controlPhys->GetPosition().x, dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(controlPhys->GetPosition()), controlPhys->GetPosition().z };

View File

@@ -2,7 +2,7 @@
#include "SkillComponent.h"
void EnemyNjBuff::OnStartup(Entity* self) {
auto skillComponent = self->GetComponent<SkillComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent == nullptr) {
return;

View File

@@ -15,7 +15,7 @@ void TreasureChestDragonServer::OnUse(Entity* self, Entity* user) {
self->SetVar<bool>(u"bUsed", true);
auto scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
if (scriptedActivityComponent == nullptr) {
return;