From 3dbbf4687601fdbec4ba6b98c002c483a3b8cb66 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 08:10:56 -0500 Subject: [PATCH] refactor(component): the bouncer reads its level config in LoadConfigData Co-Authored-By: Claude Opus 5.5 --- dGame/dComponents/BouncerComponent.cpp | 9 ++++++--- dGame/dComponents/BouncerComponent.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dGame/dComponents/BouncerComponent.cpp b/dGame/dComponents/BouncerComponent.cpp index c58fba088..f08bd71c4 100644 --- a/dGame/dComponents/BouncerComponent.cpp +++ b/dGame/dComponents/BouncerComponent.cpp @@ -16,6 +16,11 @@ BouncerComponent::BouncerComponent(Entity* parent, const int32_t componentID) : m_PetEnabled = false; m_PetBouncerEnabled = false; m_PetSwitchLoaded = false; + RegisterMsg(&BouncerComponent::MsgGetObjectReportInfo); +} + +// The level config: destination, speed, arc and targets (and the pet switch of LOT 7625) +void BouncerComponent::LoadConfigData() { m_Destination = GeneralUtils::TryParse( GeneralUtils::SplitString(m_Parent->GetVarAsString(u"bouncer_destination"), '\x1f')) .value_or(NiPoint3Constant::ZERO); @@ -29,11 +34,9 @@ BouncerComponent::BouncerComponent(Entity* parent, const int32_t componentID) : m_MinNumTargets = GeneralUtils::TryParse(m_Parent->GetVarAsString(u"num_targets_to_activate")).value_or(1); m_CinematicPath = m_Parent->GetVarAsString(u"attached_cinematic_path"); - if (parent->GetLOT() == 7625) { + if (m_Parent->GetLOT() == 7625) { LookupPetSwitch(); } - - RegisterMsg(&BouncerComponent::MsgGetObjectReportInfo); } BouncerComponent::~BouncerComponent() { diff --git a/dGame/dComponents/BouncerComponent.h b/dGame/dComponents/BouncerComponent.h index f0493ee92..4ad4c3746 100644 --- a/dGame/dComponents/BouncerComponent.h +++ b/dGame/dComponents/BouncerComponent.h @@ -15,6 +15,8 @@ public: static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BOUNCER; BouncerComponent(Entity* parentEntity, const int32_t componentID); + + void LoadConfigData() override; ~BouncerComponent() override; void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;