diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index e71d87b85..0686a7759 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -90,6 +90,7 @@ #include "CollectibleComponent.h" #include "ItemComponent.h" #include "MinifigComponent.h" +#include "PackageComponent.h" #include "ChoiceBuildComponent.h" #include "ChangelingComponent.h" #include "SpringpadComponent.h" @@ -1043,6 +1044,12 @@ void Entity::Initialize() { if (id > -1) AddComponent(id); break; } + case eReplicaComponentType::PACKAGE: { + // LWOPackageComponent: the client makes it from the registry + const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::PACKAGE, -1); + if (id > -1) AddComponent(id); + break; + } default: break; } diff --git a/dGame/dComponents/PackageComponent.h b/dGame/dComponents/PackageComponent.h new file mode 100644 index 000000000..9308c6164 --- /dev/null +++ b/dGame/dComponents/PackageComponent.h @@ -0,0 +1,17 @@ +#ifndef PACKAGECOMPONENT_H +#define PACKAGECOMPONENT_H + +#include "Component.h" +#include "eReplicaComponentType.h" + +/** + * Package, as the client's LWOPackageComponent makes it from the registry. Nothing of it is sent or done on the server yet. + */ +class PackageComponent final : public Component { +public: + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PACKAGE; + + PackageComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {} +}; + +#endif // PACKAGECOMPONENT_H