Fix microwave eating wrench (#8801)

This commit is contained in:
wrexbe
2022-06-12 16:43:28 -07:00
committed by GitHub
parent 90c224a1c1
commit 78fb4b88ed

View File

@@ -1,4 +1,5 @@
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Construction;
using Content.Server.Kitchen.Components;
using Content.Server.Popups;
using Content.Shared.Destructible;
@@ -23,7 +24,7 @@ namespace Content.Server.Kitchen.EntitySystems
base.Initialize();
SubscribeLocalEvent<MicrowaveComponent, SolutionChangedEvent>(OnSolutionChange);
SubscribeLocalEvent<MicrowaveComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<MicrowaveComponent, InteractUsingEvent>(OnInteractUsing, after: new[]{typeof(AnchorableSystem)});
SubscribeLocalEvent<MicrowaveComponent, BreakageEventArgs>(OnBreak);
SubscribeLocalEvent<MicrowaveComponent, SuicideEvent>(OnSuicide);
}
@@ -93,6 +94,7 @@ namespace Content.Server.Kitchen.EntitySystems
private void OnInteractUsing(EntityUid uid, MicrowaveComponent component, InteractUsingEvent args)
{
if(args.Handled) return;
if (!component.Powered)
{
_popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-no-power"), uid, Filter.Entities(args.User));
@@ -111,6 +113,8 @@ namespace Content.Server.Kitchen.EntitySystems
return;
}
args.Handled = true;
component.Storage.Insert(args.Used);
component.DirtyUi();
}