From 5d80e49d371b38f1bccec3298acd0c5f18a6106e Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Sat, 20 Apr 2024 18:03:11 -0400 Subject: [PATCH] Make material arbitrage test ignore price of contained entities (#27182) Material arbitrage test now ignores price of contained entities --- Content.IntegrationTests/Tests/MaterialArbitrageTest.cs | 2 +- Content.Server/Cargo/Systems/PricingSystem.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs index 42c5471c44..51be2fb431 100644 --- a/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs +++ b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs @@ -359,7 +359,7 @@ public sealed class MaterialArbitrageTest { var ent = entManager.SpawnEntity(id, testMap.GridCoords); stackSys.SetCount(ent, 1); - priceCache[id] = price = pricing.GetPrice(ent); + priceCache[id] = price = pricing.GetPrice(ent, false); entManager.DeleteEntity(ent); }); } diff --git a/Content.Server/Cargo/Systems/PricingSystem.cs b/Content.Server/Cargo/Systems/PricingSystem.cs index 9e1970d63c..f878eeee75 100644 --- a/Content.Server/Cargo/Systems/PricingSystem.cs +++ b/Content.Server/Cargo/Systems/PricingSystem.cs @@ -199,7 +199,7 @@ public sealed class PricingSystem : EntitySystem /// This fires off an event to calculate the price. /// Calculating the price of an entity that somehow contains itself will likely hang. /// - public double GetPrice(EntityUid uid) + public double GetPrice(EntityUid uid, bool includeContents = true) { var ev = new PriceCalculationEvent(); RaiseLocalEvent(uid, ref ev); @@ -222,7 +222,7 @@ public sealed class PricingSystem : EntitySystem price += GetStaticPrice(uid); } - if (TryComp(uid, out var containers)) + if (includeContents && TryComp(uid, out var containers)) { foreach (var container in containers.Containers.Values) { -- 2.52.0