mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
refactor(component): the model reads its user model ID in LoadConfigData
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,12 +25,16 @@ ModelComponent::ModelComponent(Entity* parent, const int32_t componentID) : Comp
|
||||
m_IsPaused = false;
|
||||
m_NumListeningInteract = 0;
|
||||
|
||||
m_userModelID = m_Parent->GetVarAs<LWOOBJID>(u"userModelID");
|
||||
RegisterMsg(&ModelComponent::OnRequestUse);
|
||||
RegisterMsg(&ModelComponent::OnResetModelToDefaults);
|
||||
RegisterMsg(&ModelComponent::OnGetObjectReportInfo);
|
||||
}
|
||||
|
||||
// The level config: the user model this is
|
||||
void ModelComponent::LoadConfigData() {
|
||||
m_userModelID = m_Parent->GetVarAs<LWOOBJID>(u"userModelID");
|
||||
}
|
||||
|
||||
bool ModelComponent::OnResetModelToDefaults(GameMessages::ResetModelToDefaults& reset) {
|
||||
if (reset.bResetBehaviors) for (auto& behavior : m_Behaviors) behavior.HandleMsg(reset);
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ public:
|
||||
|
||||
ModelComponent(Entity* parent, const int32_t componentID);
|
||||
|
||||
void LoadConfigData() override;
|
||||
|
||||
void LoadBehaviors();
|
||||
void Run(float deltaTime) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user