From ee86102e974325a08a358e594424b5b6fac9ab7a Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 06:35:45 -0500 Subject: [PATCH] feat(entity): NPC minifigures have the client's minifig component The client makes LWOMiniFigComponent (35) from the registry; DLU had nothing for it. It sends nothing (the client reads the MinifigComponent row itself), so constructions are unchanged; 488 LOTs gain it (LoaderSnapshotTest). Co-Authored-By: Claude Opus 5.5 --- dGame/Entity.cpp | 6 ++++++ dGame/dComponents/MinifigComponent.h | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 dGame/dComponents/MinifigComponent.h diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 1a5de2efc..b92fd8272 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -89,6 +89,7 @@ #include "RacingStatsComponent.h" #include "CollectibleComponent.h" #include "ItemComponent.h" +#include "MinifigComponent.h" #include "GhostComponent.h" #include "AchievementVendorComponent.h" #include "VanityUtilities.h" @@ -481,6 +482,11 @@ void Entity::Initialize() { } break; } + case eReplicaComponentType::MINIFIG: { + const auto minifigID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MINIFIG); + if (minifigID > 0) AddComponent(minifigID); + break; + } case eReplicaComponentType::CHARACTER: { const auto characterID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::CHARACTER); if (characterID > 0 || m_Character) { diff --git a/dGame/dComponents/MinifigComponent.h b/dGame/dComponents/MinifigComponent.h new file mode 100644 index 000000000..302c55c8f --- /dev/null +++ b/dGame/dComponents/MinifigComponent.h @@ -0,0 +1,18 @@ +#ifndef MINIFIGCOMPONENT_H +#define MINIFIGCOMPONENT_H + +#include "Component.h" +#include "eReplicaComponentType.h" + +/** + * An NPC minifigure's look (MinifigComponent row: head, torso, legs, colors, decals), as the client's LWOMiniFigComponent + * has it. The client reads it from the CDClient itself: nothing of it is sent. + */ +class MinifigComponent final : public Component { +public: + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MINIFIG; + + MinifigComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {} +}; + +#endif // MINIFIGCOMPONENT_H