Revert "Solution Entities" (#23160)
Revert "Solution Entities (#21916)"
This reverts commit d75e743dd7.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using Content.Server.Chemistry.Components;
|
||||
using Content.Server.Chemistry.Containers.EntitySystems;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Random;
|
||||
using Content.Shared.Random.Helpers;
|
||||
@@ -21,12 +21,13 @@ public sealed class SolutionRandomFillSystem : EntitySystem
|
||||
SubscribeLocalEvent<RandomFillSolutionComponent, MapInitEvent>(OnRandomSolutionFillMapInit);
|
||||
}
|
||||
|
||||
private void OnRandomSolutionFillMapInit(Entity<RandomFillSolutionComponent> entity, ref MapInitEvent args)
|
||||
private void OnRandomSolutionFillMapInit(EntityUid uid, RandomFillSolutionComponent component, MapInitEvent args)
|
||||
{
|
||||
if (entity.Comp.WeightedRandomId == null)
|
||||
if (component.WeightedRandomId == null)
|
||||
return;
|
||||
|
||||
var pick = _proto.Index<WeightedRandomFillSolutionPrototype>(entity.Comp.WeightedRandomId).Pick(_random);
|
||||
var target = _solutionsSystem.EnsureSolution(uid, component.Solution);
|
||||
var pick = _proto.Index<WeightedRandomFillSolutionPrototype>(component.WeightedRandomId).Pick(_random);
|
||||
|
||||
var reagent = pick.reagent;
|
||||
var quantity = pick.quantity;
|
||||
@@ -37,7 +38,6 @@ public sealed class SolutionRandomFillSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
var target = _solutionsSystem.EnsureSolutionEntity(entity.Owner, entity.Comp.Solution, pick.quantity, null, out _);
|
||||
_solutionsSystem.TryAddReagent(target, reagent, quantity, out _);
|
||||
target.AddReagent(reagent, quantity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user