microwave ejection tweak (#23460)
This commit is contained in:
@@ -61,6 +61,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
SubscribeLocalEvent<MicrowaveComponent, InteractUsingEvent>(OnInteractUsing, after: new[] { typeof(AnchorableSystem) });
|
SubscribeLocalEvent<MicrowaveComponent, InteractUsingEvent>(OnInteractUsing, after: new[] { typeof(AnchorableSystem) });
|
||||||
SubscribeLocalEvent<MicrowaveComponent, BreakageEventArgs>(OnBreak);
|
SubscribeLocalEvent<MicrowaveComponent, BreakageEventArgs>(OnBreak);
|
||||||
SubscribeLocalEvent<MicrowaveComponent, PowerChangedEvent>(OnPowerChanged);
|
SubscribeLocalEvent<MicrowaveComponent, PowerChangedEvent>(OnPowerChanged);
|
||||||
|
SubscribeLocalEvent<MicrowaveComponent, AnchorStateChangedEvent>(OnAnchorChanged);
|
||||||
SubscribeLocalEvent<MicrowaveComponent, SuicideEvent>(OnSuicide);
|
SubscribeLocalEvent<MicrowaveComponent, SuicideEvent>(OnSuicide);
|
||||||
SubscribeLocalEvent<MicrowaveComponent, RefreshPartsEvent>(OnRefreshParts);
|
SubscribeLocalEvent<MicrowaveComponent, RefreshPartsEvent>(OnRefreshParts);
|
||||||
SubscribeLocalEvent<MicrowaveComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
SubscribeLocalEvent<MicrowaveComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||||
@@ -279,11 +280,16 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
{
|
{
|
||||||
SetAppearance(ent, MicrowaveVisualState.Idle, ent.Comp);
|
SetAppearance(ent, MicrowaveVisualState.Idle, ent.Comp);
|
||||||
RemComp<ActiveMicrowaveComponent>(ent);
|
RemComp<ActiveMicrowaveComponent>(ent);
|
||||||
_sharedContainer.EmptyContainer(ent.Comp.Storage);
|
|
||||||
}
|
}
|
||||||
UpdateUserInterfaceState(ent, ent.Comp);
|
UpdateUserInterfaceState(ent, ent.Comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnAnchorChanged(EntityUid uid, MicrowaveComponent component, ref AnchorStateChangedEvent args)
|
||||||
|
{
|
||||||
|
if(!args.Anchored)
|
||||||
|
_sharedContainer.EmptyContainer(component.Storage);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnRefreshParts(Entity<MicrowaveComponent> ent, ref RefreshPartsEvent args)
|
private void OnRefreshParts(Entity<MicrowaveComponent> ent, ref RefreshPartsEvent args)
|
||||||
{
|
{
|
||||||
var cookRating = args.PartRatings[ent.Comp.MachinePartCookTimeMultiplier];
|
var cookRating = args.PartRatings[ent.Comp.MachinePartCookTimeMultiplier];
|
||||||
@@ -342,7 +348,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public void Wzhzhzh(EntityUid uid, MicrowaveComponent component, EntityUid? user)
|
public void Wzhzhzh(EntityUid uid, MicrowaveComponent component, EntityUid? user)
|
||||||
{
|
{
|
||||||
if (!HasContents(component) || HasComp<ActiveMicrowaveComponent>(uid))
|
if (!HasContents(component) || HasComp<ActiveMicrowaveComponent>(uid) || !(TryComp<ApcPowerReceiverComponent>(uid, out var apc) && apc.Powered))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var solidsDict = new Dictionary<string, int>();
|
var solidsDict = new Dictionary<string, int>();
|
||||||
|
|||||||
Reference in New Issue
Block a user