From da5ce99f5b0b32d58bd0d9295a5da1e6dad09359 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 08:10:56 -0500 Subject: [PATCH] refactor(component): the render component loads its animation groups in LoadDataFromTemplate Co-Authored-By: Claude Opus 5.5 --- dGame/dComponents/RenderComponent.cpp | 8 ++++++-- dGame/dComponents/RenderComponent.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dGame/dComponents/RenderComponent.cpp b/dGame/dComponents/RenderComponent.cpp index 6e994bd4f..0bfc6e643 100644 --- a/dGame/dComponents/RenderComponent.cpp +++ b/dGame/dComponents/RenderComponent.cpp @@ -19,10 +19,14 @@ std::unordered_map RenderComponent::m_DurationCache{}; RenderComponent::RenderComponent(Entity* const parentEntity, const int32_t componentID) : Component{ parentEntity, componentID } { m_LastAnimationName = ""; - if (componentID == -1) return; +} + +// The RenderComponent row: its animation groups +void RenderComponent::LoadDataFromTemplate() { + if (m_ComponentID == -1) return; auto query = CDClientDatabase::CreatePreppedStmt("SELECT * FROM RenderComponent WHERE id = ?;"); - query.bind(1, componentID); + query.bind(1, m_ComponentID); auto result = query.execQuery(); if (!result.eof()) { diff --git a/dGame/dComponents/RenderComponent.h b/dGame/dComponents/RenderComponent.h index e6edabb51..46d1a4a8b 100644 --- a/dGame/dComponents/RenderComponent.h +++ b/dGame/dComponents/RenderComponent.h @@ -65,6 +65,8 @@ public: RenderComponent(Entity* const parentEntity, const int32_t componentID); + void LoadDataFromTemplate() override; + void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override; void Run(float deltaTime) override;