Puddle refactor 2: Spillastic boogaloo (#4784)
* Refactor PuddleComponent * Move puddle effects into separate RSIs Basically egg/tomato/powder puddle will be moved into separate /Textures/Fluids RSIs * Fix YAML for puddles * Fix issues sloth pointed out. * Ensure Puddle Component are properly added when spawned * Remove unnecessary method init puddle with starting maxVolume * Addressed ElectroSr comments * Add Resolves * Try fix error in ensureSolution * Puddle unanchoring * Address some issues with puddles * Fix continue -> return
This commit is contained in:
@@ -241,7 +241,24 @@ namespace Content.Shared.Chemistry.EntitySystems
|
||||
/// <returns>solution</returns>
|
||||
public Solution EnsureSolution(IEntity owner, string name)
|
||||
{
|
||||
var solutionsMgr = owner.EnsureComponent<SolutionContainerManagerComponent>();
|
||||
return EnsureSolution(owner.Uid, name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will ensure a solution is added to given entity even if it's missing solutionContainerManager
|
||||
/// </summary>
|
||||
/// <param name="uid">EntityUid to which to add solution</param>
|
||||
/// <param name="name">name for the solution</param>
|
||||
/// <param name="solutionsMgr">solution components used in resolves</param>
|
||||
/// <returns>solution</returns>
|
||||
public Solution EnsureSolution(EntityUid uid, string name,
|
||||
SolutionContainerManagerComponent? solutionsMgr = null)
|
||||
{
|
||||
if (!Resolve(uid, ref solutionsMgr, false))
|
||||
{
|
||||
solutionsMgr = EntityManager.EnsureComponent<SolutionContainerManagerComponent>(uid);
|
||||
}
|
||||
|
||||
if (!solutionsMgr.Solutions.ContainsKey(name))
|
||||
{
|
||||
var newSolution = new Solution();
|
||||
|
||||
Reference in New Issue
Block a user