mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 10:45:27 +00:00
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:
@@ -16,6 +16,11 @@ BouncerComponent::BouncerComponent(Entity* parent, const int32_t componentID) :
|
|||||||
m_PetEnabled = false;
|
m_PetEnabled = false;
|
||||||
m_PetBouncerEnabled = false;
|
m_PetBouncerEnabled = false;
|
||||||
m_PetSwitchLoaded = 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>(
|
m_Destination = GeneralUtils::TryParse<NiPoint3>(
|
||||||
GeneralUtils::SplitString(m_Parent->GetVarAsString(u"bouncer_destination"), '\x1f'))
|
GeneralUtils::SplitString(m_Parent->GetVarAsString(u"bouncer_destination"), '\x1f'))
|
||||||
.value_or(NiPoint3Constant::ZERO);
|
.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_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");
|
m_CinematicPath = m_Parent->GetVarAsString(u"attached_cinematic_path");
|
||||||
|
|
||||||
if (parent->GetLOT() == 7625) {
|
if (m_Parent->GetLOT() == 7625) {
|
||||||
LookupPetSwitch();
|
LookupPetSwitch();
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterMsg(&BouncerComponent::MsgGetObjectReportInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BouncerComponent::~BouncerComponent() {
|
BouncerComponent::~BouncerComponent() {
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public:
|
|||||||
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BOUNCER;
|
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BOUNCER;
|
||||||
|
|
||||||
BouncerComponent(Entity* parentEntity, const int32_t componentID);
|
BouncerComponent(Entity* parentEntity, const int32_t componentID);
|
||||||
|
|
||||||
|
void LoadConfigData() override;
|
||||||
~BouncerComponent() override;
|
~BouncerComponent() override;
|
||||||
|
|
||||||
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user