using Content.Shared.Lathe;
namespace Content.Shared._DV.Lathe;
///
/// Applies modifiers when added to a lathe and removes it.
///
public sealed class LatheUpgradeSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent(OnMapInit);
}
private void OnMapInit(Entity ent, ref MapInitEvent args)
{
RemCompDeferred(ent);
if (!TryComp(ent, out var lathe))
return;
if (ent.Comp.MaterialUseMultiplier is {} matMul)
lathe.MaterialUseMultiplier = matMul;
if (ent.Comp.TimeMultiplier is {} timeMul)
lathe.TimeMultiplier = timeMul;
Dirty(ent, lathe);
}
}