Make material arbitrage test ignore price of contained entities (#27182)

Material arbitrage test now ignores price of contained entities

(cherry picked from commit 5d80e49d371b38f1bccec3298acd0c5f18a6106e)
This commit is contained in:
Tayrtahn 2024-04-20 18:03:11 -04:00 committed by NullWanderer
parent 291a03febd
commit 98153e0c6a
No known key found for this signature in database
GPG Key ID: 212F05528FD678BE
2 changed files with 3 additions and 3 deletions

View File

@ -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);
});
}

View File

@ -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.
/// </remarks>
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<ContainerManagerComponent>(uid, out var containers))
if (includeContents && TryComp<ContainerManagerComponent>(uid, out var containers))
{
foreach (var container in containers.Containers.Values)
{