Entities gib when being microwaved (#8144)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Kitchen.Components;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.MobState.Components;
|
||||
@@ -19,6 +20,7 @@ namespace Content.Server.Body.Systems
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<BodyComponent, RelayMoveInputEvent>(OnRelayMoveInput);
|
||||
SubscribeLocalEvent<BodyComponent, ApplyMetabolicMultiplierEvent>(OnApplyMetabolicMultiplier);
|
||||
SubscribeLocalEvent<BodyComponent, BeingMicrowavedEvent>(OnBeingMicrowaved);
|
||||
}
|
||||
|
||||
private void OnRelayMoveInput(EntityUid uid, BodyComponent component, RelayMoveInputEvent args)
|
||||
@@ -46,6 +48,18 @@ namespace Content.Server.Body.Systems
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBeingMicrowaved(EntityUid uid, BodyComponent component, BeingMicrowavedEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
// Don't microwave animals, kids
|
||||
Transform(uid).AttachToGridOrMap();
|
||||
component.Gib();
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of ValueTuples of <see cref="T"/> and MechanismComponent on each mechanism
|
||||
/// in the given body.
|
||||
|
||||
@@ -211,7 +211,10 @@ namespace Content.Server.Kitchen.Components
|
||||
_entities.EventBus.RaiseLocalEvent(item, ev, false);
|
||||
|
||||
if (ev.Handled)
|
||||
{
|
||||
UIDirty = true;
|
||||
return;
|
||||
}
|
||||
|
||||
var tagSys = EntitySystem.Get<TagSystem>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user