Infinate chem dupe fixed (Toilet, drain) + dirty water toilet fix (#27446)
innital commit
This commit is contained in:
@@ -87,19 +87,25 @@ public sealed class DrainSystem : SharedDrainSystem
|
|||||||
|
|
||||||
// Try to transfer as much solution as possible to the drain
|
// Try to transfer as much solution as possible to the drain
|
||||||
|
|
||||||
var transferSolution = _solutionContainerSystem.SplitSolution(containerSoln.Value,
|
var amountToPutInDrain = drainSolution.AvailableVolume;
|
||||||
FixedPoint2.Min(containerSolution.Volume, drainSolution.AvailableVolume));
|
var amountToSpillOnGround = containerSolution.Volume - drainSolution.AvailableVolume;
|
||||||
|
|
||||||
_solutionContainerSystem.TryAddSolution(drain.Solution.Value, transferSolution);
|
if (amountToPutInDrain > 0)
|
||||||
|
|
||||||
_audioSystem.PlayPvs(drain.ManualDrainSound, target);
|
|
||||||
_ambientSoundSystem.SetAmbience(target, true);
|
|
||||||
|
|
||||||
// If drain is full, spill
|
|
||||||
|
|
||||||
if (drainSolution.MaxVolume == drainSolution.Volume)
|
|
||||||
{
|
{
|
||||||
_puddleSystem.TrySpillAt(Transform(target).Coordinates, containerSolution, out _);
|
var solutionToPutInDrain = _solutionContainerSystem.SplitSolution(containerSoln.Value, amountToPutInDrain);
|
||||||
|
_solutionContainerSystem.TryAddSolution(drain.Solution.Value, solutionToPutInDrain);
|
||||||
|
|
||||||
|
_audioSystem.PlayPvs(drain.ManualDrainSound, target);
|
||||||
|
_ambientSoundSystem.SetAmbience(target, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Spill the remainder.
|
||||||
|
|
||||||
|
if (amountToSpillOnGround > 0)
|
||||||
|
{
|
||||||
|
var solutionToSpill = _solutionContainerSystem.SplitSolution(containerSoln.Value, amountToSpillOnGround);
|
||||||
|
_puddleSystem.TrySpillAt(Transform(target).Coordinates, solutionToSpill, out _);
|
||||||
_popupSystem.PopupEntity(
|
_popupSystem.PopupEntity(
|
||||||
Loc.GetString("drain-component-empty-verb-target-is-full-message", ("object", target)),
|
Loc.GetString("drain-component-empty-verb-target-is-full-message", ("object", target)),
|
||||||
container);
|
container);
|
||||||
|
|||||||
@@ -104,7 +104,10 @@
|
|||||||
components:
|
components:
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
toilet:
|
drainBuffer:
|
||||||
|
maxVol: 100
|
||||||
|
tank:
|
||||||
|
maxVol: 500
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Water
|
- ReagentId: Water
|
||||||
Quantity: 180
|
Quantity: 180
|
||||||
|
|||||||
Reference in New Issue
Block a user