Basic liver mechanism (#3424)

* Basic liver mechanism

* makes the stupid thing work
This commit is contained in:
ike709
2021-02-27 19:58:08 -06:00
committed by GitHub
parent a9a96f2edc
commit 7b3e25b3ef
5 changed files with 136 additions and 45 deletions

View File

@@ -1,6 +1,7 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.Body.Circulatory;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Shared.Chemistry;
using Content.Shared.GameObjects.Components.Body.Networks;
@@ -44,8 +45,8 @@ namespace Content.Server.GameObjects.Components.Body.Behavior
_accumulatedFrameTime -= 1;
if (!Owner.TryGetComponent(out SharedSolutionContainerComponent? solution) ||
!Body.Owner.TryGetComponent(out SharedBloodstreamComponent? bloodstream))
if (!Body.Owner.TryGetComponent(out SolutionContainerComponent? solution) ||
!Body.Owner.TryGetComponent(out BloodstreamComponent? bloodstream))
{
return;
}
@@ -138,10 +139,10 @@ namespace Content.Server.GameObjects.Components.Body.Behavior
public bool TryTransferSolution(Solution solution)
{
if (!CanTransferSolution(solution))
if (Body == null || !CanTransferSolution(solution))
return false;
if (!Owner.TryGetComponent(out SharedSolutionContainerComponent? solutionComponent))
if (!Body.Owner.TryGetComponent(out SolutionContainerComponent? solutionComponent))
{
return false;
}