From 3bd299d682896853d555f5332ca828909a261217 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 06:31:19 -0500 Subject: [PATCH] fix(entity): a quick build without a destroyable gets one, as the client makes it DoObjectComponentLoad adds a destroyable (componentID -1) to a quick build that has none and marks it smashable. DLU's quick build wrote three empty flags instead. The construction's destroyable now matches live field for field (AG LOT 7804: health 1 / 1.0, armor 1 / 0, faction -1, smashable). 117 LOTs gain it; nothing else changes (LoaderSnapshotTest). Co-Authored-By: Claude Opus 5.5 --- dGame/Entity.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 3bef88b26..a0f7a27a1 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -669,6 +669,17 @@ void Entity::Initialize() { if (quickBuildComponentID > 0) { auto* const quickBuildComponent = AddComponent(quickBuildComponentID); + // A quick build without a destroyable gets one (componentID -1) and is smashable, as the client makes it + // (DoObjectComponentLoad); live: health 1 / 1.0, armor 1 / 0, faction -1, smashable (AG LOT 7804) + if (!HasComponent(eReplicaComponentType::DESTROYABLE)) { + auto* const destroyable = AddComponent(-1); + destroyable->SetMaxHealth(1.0f); + destroyable->SetHealth(1); + destroyable->SetArmor(1); + destroyable->SetFaction(-1, true); + destroyable->SetIsSmashable(true); + } + CDRebuildComponentTable* const rebCompTable = CDClientManager::GetTable(); const std::vector rebCompData = rebCompTable->Query([quickBuildComponentID](CDRebuildComponent entry) { return (entry.id == quickBuildComponentID); });