refactor(component): the render component loads its animation groups in LoadDataFromTemplate

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 7a0013696b
commit da5ce99f5b
2 changed files with 8 additions and 2 deletions

View File

@@ -19,10 +19,14 @@ std::unordered_map<int32_t, float> 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()) {

View File

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