From b3606a0e02c751734fbc28546a05c7d7c37222d5 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 10 Nov 2026 16:13:49 -0600 Subject: [PATCH] fix: adapt the trade's model check to the moderation status sent for a blueprint The blueprint data a world server sends for a stored brick built model says that the model is approved, and the client goes by that over the status the item itself carries. A model item that names a blueprint is taken into a trade for that reason, and the item's own status only decides for a model without one. Co-Authored-By: Claude Fable 5.2 --- dGame/TradingManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dGame/TradingManager.cpp b/dGame/TradingManager.cpp index 79032234e..0cd73e2db 100644 --- a/dGame/TradingManager.cpp +++ b/dGame/TradingManager.cpp @@ -1,4 +1,5 @@ #include "TradingManager.h" +#include "BrickByBrick.h" #include "EconomyLedger.h" #include "dServer.h" #include "EntityManager.h" @@ -55,9 +56,13 @@ std::function(LWOOBJID)> Trade::HeldIn(const Invent return [&inventory](const LWOOBJID itemId) -> std::optional { const auto* const item = inventory.FindItemById(itemId); if (!item) return std::nullopt; + // The blueprint data sent for a stored model says it is approved (BlueprintMetadata), and the client goes + // by that over the status the item itself carries + const bool hasBlueprint = item->GetLot() == BrickBuiltModelLot + && BrickByBrick::ConfigObjectId(item->GetConfig(), u"blueprintid") != LWOOBJID_EMPTY; return HeldTradeItem{ item->GetLot(), item->GetCount(), item->GetBound(), item->IsEquipped(), - inventory.CanDelete(*item), IsApproved(item->GetLot(), item->GetConfig()) + inventory.CanDelete(*item), hasBlueprint || IsApproved(item->GetLot(), item->GetConfig()) }; }; }