refactor(component): the bouncer reads its level config in LoadConfigData

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-01 08:10:56 -05:00
parent 6fc19c114d
commit 3dbbf46876
2 changed files with 8 additions and 3 deletions

View File

@@ -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<NiPoint3>(
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<int32_t>(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() {

View File

@@ -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;