Adds missing reactions to chemical stuff.
- Adds ingestion reaction for food, drinks, and pills. - Adds injection reaction for syringes.
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.Components.Body.Digestive
|
||||
solution.MaxVolume = _initialMaxVolume;
|
||||
}
|
||||
|
||||
public bool TryTransferSolution(Solution solution)
|
||||
public bool CanTransferSolution(Solution solution)
|
||||
{
|
||||
if (!Owner.TryGetComponent(out SolutionContainerComponent? solutionComponent))
|
||||
{
|
||||
@@ -80,11 +80,21 @@ namespace Content.Server.GameObjects.Components.Body.Digestive
|
||||
}
|
||||
|
||||
// TODO: For now no partial transfers. Potentially change by design
|
||||
if (solution.TotalVolume + solutionComponent.CurrentVolume > solutionComponent.MaxVolume)
|
||||
if (!solutionComponent.CanAddSolution(solution))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryTransferSolution(Solution solution)
|
||||
{
|
||||
if (!CanTransferSolution(solution))
|
||||
return false;
|
||||
|
||||
var solutionComponent = Owner.GetComponent<SolutionContainerComponent>();
|
||||
|
||||
// Add solution to _stomachContents
|
||||
solutionComponent.TryAddSolution(solution, false, true);
|
||||
// Add each reagent to _reagentDeltas. Used to track how long each reagent has been in the stomach
|
||||
|
||||
Reference in New Issue
Block a user