Fix microwave eating wrench (#8801)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Content.Server.Chemistry.EntitySystems;
|
using Content.Server.Chemistry.EntitySystems;
|
||||||
|
using Content.Server.Construction;
|
||||||
using Content.Server.Kitchen.Components;
|
using Content.Server.Kitchen.Components;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Shared.Destructible;
|
using Content.Shared.Destructible;
|
||||||
@@ -23,7 +24,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<MicrowaveComponent, SolutionChangedEvent>(OnSolutionChange);
|
SubscribeLocalEvent<MicrowaveComponent, SolutionChangedEvent>(OnSolutionChange);
|
||||||
SubscribeLocalEvent<MicrowaveComponent, InteractUsingEvent>(OnInteractUsing);
|
SubscribeLocalEvent<MicrowaveComponent, InteractUsingEvent>(OnInteractUsing, after: new[]{typeof(AnchorableSystem)});
|
||||||
SubscribeLocalEvent<MicrowaveComponent, BreakageEventArgs>(OnBreak);
|
SubscribeLocalEvent<MicrowaveComponent, BreakageEventArgs>(OnBreak);
|
||||||
SubscribeLocalEvent<MicrowaveComponent, SuicideEvent>(OnSuicide);
|
SubscribeLocalEvent<MicrowaveComponent, SuicideEvent>(OnSuicide);
|
||||||
}
|
}
|
||||||
@@ -93,6 +94,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
|
|
||||||
private void OnInteractUsing(EntityUid uid, MicrowaveComponent component, InteractUsingEvent args)
|
private void OnInteractUsing(EntityUid uid, MicrowaveComponent component, InteractUsingEvent args)
|
||||||
{
|
{
|
||||||
|
if(args.Handled) return;
|
||||||
if (!component.Powered)
|
if (!component.Powered)
|
||||||
{
|
{
|
||||||
_popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-no-power"), uid, Filter.Entities(args.User));
|
_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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args.Handled = true;
|
||||||
|
|
||||||
component.Storage.Insert(args.Used);
|
component.Storage.Insert(args.Used);
|
||||||
component.DirtyUi();
|
component.DirtyUi();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user