format codebase

This commit is contained in:
2022-07-28 08:39:57 -05:00
parent 4f7aa11067
commit 19e77a38d8
881 changed files with 34700 additions and 38689 deletions

View File

@@ -1,34 +1,34 @@
#include "PetFromObjectServer.h"
#include "PetComponent.h"
void PetFromObjectServer::OnStartup(Entity *self) {
self->SetNetworkVar(u"pettamer", std::to_string(self->GetVar<LWOOBJID>(u"tamer")));
self->AddTimer("killSelf", 45.0f);
void PetFromObjectServer::OnStartup(Entity* self) {
self->SetNetworkVar(u"pettamer", std::to_string(self->GetVar<LWOOBJID>(u"tamer")));
self->AddTimer("killSelf", 45.0f);
}
void PetFromObjectServer::OnTimerDone(Entity *self, std::string timerName) {
if (timerName == "killSelf") {
const auto* petComponent = self->GetComponent<PetComponent>();
if (petComponent == nullptr || petComponent->GetOwner() != nullptr)
return;
self->Smash(self->GetObjectID(), SILENT);
}
void PetFromObjectServer::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "killSelf") {
const auto* petComponent = self->GetComponent<PetComponent>();
if (petComponent == nullptr || petComponent->GetOwner() != nullptr)
return;
self->Smash(self->GetObjectID(), SILENT);
}
}
void PetFromObjectServer::OnNotifyPetTamingMinigame(Entity *self, Entity *tamer, eNotifyType type) {
switch (type) {
case NOTIFY_TYPE_BEGIN:
self->CancelAllTimers();
break;
case NOTIFY_TYPE_QUIT:
case NOTIFY_TYPE_FAILED:
self->Smash(self->GetObjectID(), SILENT);
break;
case NOTIFY_TYPE_SUCCESS:
// TODO: Remove from groups?
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UpdateSuccessPicking", 0,
0, tamer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
default:
break;
}
void PetFromObjectServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {
switch (type) {
case NOTIFY_TYPE_BEGIN:
self->CancelAllTimers();
break;
case NOTIFY_TYPE_QUIT:
case NOTIFY_TYPE_FAILED:
self->Smash(self->GetObjectID(), SILENT);
break;
case NOTIFY_TYPE_SUCCESS:
// TODO: Remove from groups?
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UpdateSuccessPicking", 0,
0, tamer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
default:
break;
}
}