diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index 6a436ff62..4090b1019 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -108,9 +108,14 @@ InventoryComponent::InventoryComponent(Entity* parent, const int32_t componentID if (character) LoadXml(character->GetXMLDoc()); CheckProxyIntegrity(); - - return; } +} + +// An object's starting inventory from the InventoryComponent rows, with the equipped items (a character's comes from +// its save instead) +void InventoryComponent::LoadDataFromTemplate() { + const auto lot = m_Parent->GetLOT(); + if (lot == 1) return; auto* compRegistryTable = CDClientManager::GetTable(); const auto componentId = compRegistryTable->GetByIDAndType(lot, eReplicaComponentType::INVENTORY); diff --git a/dGame/dComponents/InventoryComponent.h b/dGame/dComponents/InventoryComponent.h index 231de8ea9..aea57a8a2 100644 --- a/dGame/dComponents/InventoryComponent.h +++ b/dGame/dComponents/InventoryComponent.h @@ -101,6 +101,8 @@ public: static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::INVENTORY; InventoryComponent(Entity* parent, const int32_t componentID); + void LoadDataFromTemplate() override; + void Run(float deltaTime) override; void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override; void LoadXml(const tinyxml2::XMLDocument& document);