From 4dba9c2aeb7714f13541f995536dad23c10ca0c3 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 07:10:50 -0500 Subject: [PATCH] feat(entity): the client's custom build assembly component (59) Co-Authored-By: Claude Opus 5.5 --- dGame/Entity.cpp | 7 +++++++ .../dComponents/CustomBuildAssemblyComponent.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 dGame/dComponents/CustomBuildAssemblyComponent.h diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 0686a7759..37ac00789 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -90,6 +90,7 @@ #include "CollectibleComponent.h" #include "ItemComponent.h" #include "MinifigComponent.h" +#include "CustomBuildAssemblyComponent.h" #include "PackageComponent.h" #include "ChoiceBuildComponent.h" #include "ChangelingComponent.h" @@ -1050,6 +1051,12 @@ void Entity::Initialize() { if (id > -1) AddComponent(id); break; } + case eReplicaComponentType::CUSTOM_BUILD_ASSEMBLY: { + // LWOCustomBuildAssemblyComponent: the client makes it from the registry + const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::CUSTOM_BUILD_ASSEMBLY, -1); + if (id > -1) AddComponent(id); + break; + } default: break; } diff --git a/dGame/dComponents/CustomBuildAssemblyComponent.h b/dGame/dComponents/CustomBuildAssemblyComponent.h new file mode 100644 index 000000000..e68093c56 --- /dev/null +++ b/dGame/dComponents/CustomBuildAssemblyComponent.h @@ -0,0 +1,17 @@ +#ifndef CUSTOMBUILDASSEMBLYCOMPONENT_H +#define CUSTOMBUILDASSEMBLYCOMPONENT_H + +#include "Component.h" +#include "eReplicaComponentType.h" + +/** + * Custom build assembly, as the client's LWOCustomBuildAssemblyComponent makes it from the registry. Nothing of it is sent or done on the server yet. + */ +class CustomBuildAssemblyComponent final : public Component { +public: + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::CUSTOM_BUILD_ASSEMBLY; + + CustomBuildAssemblyComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {} +}; + +#endif // CUSTOMBUILDASSEMBLYCOMPONENT_H