Puddle Evaporation Fix (#6584)

This commit is contained in:
Willhelm53
2022-02-10 15:07:21 -06:00
committed by GitHub
parent 08b773d394
commit 8d29047a3a
5 changed files with 37 additions and 14 deletions

View File

@@ -68,10 +68,14 @@ namespace Content.Server.Fluids.EntitySystems
var volumeScale = puddleComponent.CurrentVolume.Float() / puddleComponent.OverflowVolume.Float();
var puddleSolution = _solutionContainerSystem.EnsureSolution(uid, puddleComponent.SolutionName);
// Puddles with volume below this threshold will have their sprite changed to a wet floor effect
var wetFloorEffectThreshold = FixedPoint2.New(5);
bool hasEvaporationComponent = EntityManager.TryGetComponent<EvaporationComponent>(uid, out var evaporationComponent);
bool canEvaporate = (hasEvaporationComponent &&
(evaporationComponent.LowerLimit == 0 || puddleComponent.CurrentVolume > evaporationComponent.LowerLimit));
// "Does this puddle's sprite need changing to the wet floor effect sprite?"
bool changeToWetFloor = (puddleComponent.CurrentVolume <= wetFloorEffectThreshold);
bool changeToWetFloor = (puddleComponent.CurrentVolume <= puddleComponent.WetFloorEffectThreshold
&& canEvaporate);
appearanceComponent.SetData(PuddleVisuals.VolumeScale, volumeScale);
appearanceComponent.SetData(PuddleVisuals.SolutionColor, puddleSolution.Color);