Vapor logs (#16505)
This commit is contained in:
@@ -29,9 +29,12 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
|
|
||||||
private const float ReactTime = 0.125f;
|
private const float ReactTime = 0.125f;
|
||||||
|
|
||||||
|
private ISawmill _sawmill = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
_sawmill = Logger.GetSawmill("vapor");
|
||||||
SubscribeLocalEvent<VaporComponent, StartCollideEvent>(HandleCollide);
|
SubscribeLocalEvent<VaporComponent, StartCollideEvent>(HandleCollide);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,8 +120,17 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
{
|
{
|
||||||
if (reagentQuantity.Quantity == FixedPoint2.Zero) continue;
|
if (reagentQuantity.Quantity == FixedPoint2.Zero) continue;
|
||||||
var reagent = _protoManager.Index<ReagentPrototype>(reagentQuantity.ReagentId);
|
var reagent = _protoManager.Index<ReagentPrototype>(reagentQuantity.ReagentId);
|
||||||
_solutionContainerSystem.TryRemoveReagent(vapor.Owner, contents, reagentQuantity.ReagentId,
|
|
||||||
reagent.ReactionTile(tile, (reagentQuantity.Quantity / vapor.TransferAmount) * 0.25f));
|
var reaction =
|
||||||
|
reagent.ReactionTile(tile, (reagentQuantity.Quantity / vapor.TransferAmount) * 0.25f);
|
||||||
|
|
||||||
|
if (reaction > reagentQuantity.Quantity)
|
||||||
|
{
|
||||||
|
_sawmill.Error($"Tried to tile react more than we have for reagent {reagentQuantity.ReagentId}. Found {reaction} and we only have {reagentQuantity.Quantity}");
|
||||||
|
reaction = reagentQuantity.Quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
_solutionContainerSystem.TryRemoveReagent(vapor.Owner, contents, reagentQuantity.ReagentId, reaction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user