diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 73eb2c4c3..f6b017465 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -90,6 +90,7 @@ #include "CollectibleComponent.h" #include "ItemComponent.h" #include "MinifigComponent.h" +#include "ModuleComponent.h" #include "BlueprintComponent.h" #include "ChestComponent.h" #include "RebuildActivatorComponent.h" @@ -1001,6 +1002,12 @@ void Entity::Initialize() { if (id > -1) AddComponent(id); break; } + case eReplicaComponentType::MODULE: { + // LWOModuleComponent: the client makes it from the registry + const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MODULE, -1); + if (id > -1) AddComponent(id); + break; + } default: break; } diff --git a/dGame/dComponents/ModuleComponent.h b/dGame/dComponents/ModuleComponent.h new file mode 100644 index 000000000..76d809697 --- /dev/null +++ b/dGame/dComponents/ModuleComponent.h @@ -0,0 +1,17 @@ +#ifndef MODULECOMPONENT_H +#define MODULECOMPONENT_H + +#include "Component.h" +#include "eReplicaComponentType.h" + +/** + * Module (a car or rocket part), as the client's LWOModuleComponent makes it from the registry. Nothing of it is sent or done on the server yet. + */ +class ModuleComponent final : public Component { +public: + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MODULE; + + ModuleComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {} +}; + +#endif // MODULECOMPONENT_H