Fix Reagent Grinder being able to do work without being powered (#30267)

* Check if grinder is powered before doing work

* Use existing extention method.
This commit is contained in:
Benjamin Velliquette
2024-07-23 17:02:07 -04:00
committed by GitHub
parent ec071ceca7
commit a32f9ff711

View File

@@ -157,7 +157,7 @@ namespace Content.Server.Kitchen.EntitySystems
var outputContainer = _itemSlotsSystem.GetItemOrNull(uid, SharedReagentGrinder.BeakerSlotId);
_appearanceSystem.SetData(uid, ReagentGrinderVisualState.BeakerAttached, outputContainer.HasValue);
if (reagentGrinder.AutoMode != GrinderAutoMode.Off && !HasComp<ActiveReagentGrinderComponent>(uid))
if (reagentGrinder.AutoMode != GrinderAutoMode.Off && !HasComp<ActiveReagentGrinderComponent>(uid) && this.IsPowered(uid, EntityManager))
{
var program = reagentGrinder.AutoMode == GrinderAutoMode.Grind ? GrinderProgram.Grind : GrinderProgram.Juice;
DoWork(uid, reagentGrinder, program);