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

@@ -10,7 +10,7 @@ void ActMine::OnStartup(Entity* self) {
void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
if (state == eRebuildState::COMPLETED) {
auto* rebuild = self->GetComponent<RebuildComponent>();
auto rebuild = self->GetComponent<RebuildComponent>();
if (rebuild) {
auto* builder = rebuild->GetBuilder();
self->SetVar(u"Builder", builder->GetObjectID());
@@ -24,7 +24,7 @@ void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
}
void ActMine::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
auto* detroyable = self->GetComponent<DestroyableComponent>();
auto detroyable = self->GetComponent<DestroyableComponent>();
if (!detroyable) return;
if (status == "ENTER" && self->GetVar<bool>(u"RebuildComplete") == true && detroyable->IsEnemy(entering)) {
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
@@ -35,7 +35,7 @@ void ActMine::OnProximityUpdate(Entity* self, Entity* entering, std::string name
void ActMine::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "Tick") {
if (self->GetVar<int>(u"NumWarnings") >= MAX_WARNINGS) {
auto* skill = self->GetComponent<SkillComponent>();
auto skill = self->GetComponent<SkillComponent>();
if (!skill) return;
skill->CalculateBehavior(SKILL_ID, BEHAVIOR_ID, LWOOBJID_EMPTY);
self->AddTimer("BlowedUp", BLOWED_UP_TIME);

View File

@@ -8,7 +8,7 @@
void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
auto* possessableComponent = target->GetComponent<PossessableComponent>();
auto possessableComponent = target->GetComponent<PossessableComponent>();
Entity* vehicle;
Entity* player;
@@ -22,7 +22,7 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
return;
} else if (target->IsPlayer()) {
auto* possessorComponent = target->GetComponent<PossessorComponent>();
auto possessorComponent = target->GetComponent<PossessorComponent>();
if (possessorComponent == nullptr) {
return;
@@ -44,7 +44,7 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
auto racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
if (racingControlComponent != nullptr) {
racingControlComponent->OnRequestDie(player);