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

@@ -3,7 +3,7 @@
#include "ePetTamingNotifyType.h"
void CrabServer::OnStartup(Entity* self) {
auto* petComponent = self->GetComponent<PetComponent>();
auto petComponent = self->GetComponent<PetComponent>();
if (petComponent == nullptr || petComponent->GetOwner() != nullptr)
return;
@@ -20,7 +20,7 @@ void CrabServer::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "killself") {
// Don't accidentally kill a pet that is already owned
auto* petComponent = self->GetComponent<PetComponent>();
auto petComponent = self->GetComponent<PetComponent>();
if (petComponent == nullptr || petComponent->GetOwner() != nullptr)
return;
@@ -34,7 +34,7 @@ void CrabServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTami
} else if (type == ePetTamingNotifyType::QUIT || type == ePetTamingNotifyType::FAILED) {
self->Smash(self->GetObjectID(), eKillType::SILENT);
} else if (type == ePetTamingNotifyType::SUCCESS) {
auto* petComponent = self->GetComponent<PetComponent>();
auto petComponent = self->GetComponent<PetComponent>();
if (petComponent == nullptr)
return;
// TODO: Remove custom group?