From b971d91a2507964156262dd8947af6628d709246 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 06:38:00 -0500 Subject: [PATCH] feat(entity): the client's sound repeater component (54) Co-Authored-By: Claude Opus 5.5 --- dGame/Entity.cpp | 7 +++++++ dGame/dComponents/SoundRepeaterComponent.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 dGame/dComponents/SoundRepeaterComponent.h diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index b92fd8272..c4c83ea2f 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -90,6 +90,7 @@ #include "CollectibleComponent.h" #include "ItemComponent.h" #include "MinifigComponent.h" +#include "SoundRepeaterComponent.h" #include "GhostComponent.h" #include "AchievementVendorComponent.h" #include "VanityUtilities.h" @@ -931,6 +932,12 @@ void Entity::Initialize() { } break; } + case eReplicaComponentType::SOUND_REPEATER: { + // LWOSoundRepeaterComponent: the client makes it from the registry + const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::SOUND_REPEATER, -1); + if (id > -1) AddComponent(id); + break; + } default: break; } diff --git a/dGame/dComponents/SoundRepeaterComponent.h b/dGame/dComponents/SoundRepeaterComponent.h new file mode 100644 index 000000000..90d63a258 --- /dev/null +++ b/dGame/dComponents/SoundRepeaterComponent.h @@ -0,0 +1,17 @@ +#ifndef SOUNDREPEATERCOMPONENT_H +#define SOUNDREPEATERCOMPONENT_H + +#include "Component.h" +#include "eReplicaComponentType.h" + +/** + * A repeating sound the client plays (SoundRepeaterComponent row), as the client's LWOSoundRepeaterComponent; the server sends nothing for it. + */ +class SoundRepeaterComponent final : public Component { +public: + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SOUND_REPEATER; + + SoundRepeaterComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {} +}; + +#endif // SOUNDREPEATERCOMPONENT_H