format codebase

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

View File

@@ -13,8 +13,7 @@ BouncerComponent::BouncerComponent(Entity* parent) : Component(parent) {
m_PetBouncerEnabled = false;
m_PetSwitchLoaded = false;
if (parent->GetLOT() == 7625)
{
if (parent->GetLOT() == 7625) {
LookupPetSwitch();
}
}
@@ -22,68 +21,56 @@ BouncerComponent::BouncerComponent(Entity* parent) : Component(parent) {
BouncerComponent::~BouncerComponent() {
}
void BouncerComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags){
void BouncerComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
outBitStream->Write(m_PetEnabled);
if (m_PetEnabled) {
outBitStream->Write(m_PetBouncerEnabled);
}
}
Entity* BouncerComponent::GetParentEntity() const
{
Entity* BouncerComponent::GetParentEntity() const {
return m_Parent;
}
void BouncerComponent::SetPetEnabled(bool value)
{
void BouncerComponent::SetPetEnabled(bool value) {
m_PetEnabled = value;
EntityManager::Instance()->SerializeEntity(m_Parent);
}
void BouncerComponent::SetPetBouncerEnabled(bool value)
{
void BouncerComponent::SetPetBouncerEnabled(bool value) {
m_PetBouncerEnabled = value;
GameMessages::SendBouncerActiveStatus(m_Parent->GetObjectID(), value, UNASSIGNED_SYSTEM_ADDRESS);
EntityManager::Instance()->SerializeEntity(m_Parent);
if (value)
{
if (value) {
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), 1513, u"create", "PetOnSwitch", LWOOBJID_EMPTY, 1, 1, true);
}
else
{
} else {
GameMessages::SendStopFXEffect(m_Parent, true, "PetOnSwitch");
}
}
bool BouncerComponent::GetPetEnabled() const
{
bool BouncerComponent::GetPetEnabled() const {
return m_PetEnabled;
}
bool BouncerComponent::GetPetBouncerEnabled() const
{
bool BouncerComponent::GetPetBouncerEnabled() const {
return m_PetBouncerEnabled;
}
void BouncerComponent::LookupPetSwitch()
{
void BouncerComponent::LookupPetSwitch() {
const auto& groups = m_Parent->GetGroups();
for (const auto& group : groups)
{
for (const auto& group : groups) {
const auto& entities = EntityManager::Instance()->GetEntitiesInGroup(group);
for (auto* entity : entities)
{
for (auto* entity : entities) {
auto* switchComponent = entity->GetComponent<SwitchComponent>();
if (switchComponent != nullptr)
{
if (switchComponent != nullptr) {
switchComponent->SetPetBouncer(this);
m_PetSwitchLoaded = true;
@@ -96,12 +83,11 @@ void BouncerComponent::LookupPetSwitch()
}
}
if (!m_PetSwitchLoaded)
{
if (!m_PetSwitchLoaded) {
Game::logger->Log("BouncerComponent", "Failed to load pet bouncer");
m_Parent->AddCallbackTimer(0.5f, [this]() {
LookupPetSwitch();
});
});
}
}