mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
refactor(component): the possessable loads its row in LoadDataFromTemplate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,13 +8,17 @@
|
||||
PossessableComponent::PossessableComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {
|
||||
RegisterMsg(&PossessableComponent::OnRequestUse);
|
||||
m_Possessor = LWOOBJID_EMPTY;
|
||||
}
|
||||
|
||||
// The item's animation flag and the PossessableComponent row
|
||||
void PossessableComponent::LoadDataFromTemplate() {
|
||||
CDItemComponent item = Inventory::FindItemComponent(m_Parent->GetLOT());
|
||||
m_AnimationFlag = static_cast<eAnimationFlags>(item.animationFlag);
|
||||
|
||||
// Get the possession Type from the CDClient
|
||||
auto query = CDClientDatabase::CreatePreppedStmt("SELECT possessionType, depossessOnHit, skillSet FROM PossessableComponent WHERE id = ?;");
|
||||
|
||||
query.bind(1, static_cast<int>(componentID));
|
||||
query.bind(1, static_cast<int>(m_ComponentID));
|
||||
|
||||
auto result = query.execQuery();
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ public:
|
||||
|
||||
PossessableComponent(Entity* parentEntity, const int32_t componentID);
|
||||
|
||||
void LoadDataFromTemplate() override;
|
||||
|
||||
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user