Make material arbitrage test ignore price of contained entities (#27182)
Material arbitrage test now ignores price of contained entities
This commit is contained in:
@@ -359,7 +359,7 @@ public sealed class MaterialArbitrageTest
|
|||||||
{
|
{
|
||||||
var ent = entManager.SpawnEntity(id, testMap.GridCoords);
|
var ent = entManager.SpawnEntity(id, testMap.GridCoords);
|
||||||
stackSys.SetCount(ent, 1);
|
stackSys.SetCount(ent, 1);
|
||||||
priceCache[id] = price = pricing.GetPrice(ent);
|
priceCache[id] = price = pricing.GetPrice(ent, false);
|
||||||
entManager.DeleteEntity(ent);
|
entManager.DeleteEntity(ent);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ public sealed class PricingSystem : EntitySystem
|
|||||||
/// This fires off an event to calculate the price.
|
/// This fires off an event to calculate the price.
|
||||||
/// Calculating the price of an entity that somehow contains itself will likely hang.
|
/// Calculating the price of an entity that somehow contains itself will likely hang.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public double GetPrice(EntityUid uid)
|
public double GetPrice(EntityUid uid, bool includeContents = true)
|
||||||
{
|
{
|
||||||
var ev = new PriceCalculationEvent();
|
var ev = new PriceCalculationEvent();
|
||||||
RaiseLocalEvent(uid, ref ev);
|
RaiseLocalEvent(uid, ref ev);
|
||||||
@@ -222,7 +222,7 @@ public sealed class PricingSystem : EntitySystem
|
|||||||
price += GetStaticPrice(uid);
|
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)
|
foreach (var container in containers.Containers.Values)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user