Fix crash related to reagent reactions

This commit is contained in:
Víctor Aguilera Puerto
2020-10-21 23:08:31 +02:00
parent 1f56b5db0b
commit e98abd923c
2 changed files with 4 additions and 1 deletions

View File

@@ -188,7 +188,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
foreach (var (reagentId, quantity) in split.Contents)
{
if (!_prototypeManager.TryIndex(reagentId, out ReagentPrototype reagent)) continue;
split.RemoveReagent(reagentId, reagent.ReactionEntity(target, ReactionMethod.Ingestion, quantity));
split.RemoveReagent(reagentId, reagent.ReactionEntity(trueTarget, ReactionMethod.Ingestion, quantity));
}
firstStomach.TryTransferSolution(split);

View File

@@ -88,6 +88,9 @@ namespace Content.Shared.Chemistry
{
var removed = ReagentUnit.Zero;
if (entity == null || entity.Deleted)
return removed;
foreach (var react in entity.GetAllComponents<IReagentReaction>())
{
switch (method)