* Fixes #4114 Disposals now drop their contents if destroyed or if unwrenched * Update DisposalUnitSystem.cs * Update DisposalUnitSystem.cs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Disposal.Unit.Components;
|
||||
using Content.Server.Disposal.Unit.Components;
|
||||
using Content.Server.Construction.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
@@ -9,15 +10,19 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<DisposalUnitComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, AnchoredEvent>(OnAnchored);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, UnanchoredEvent>(OnUnanchored);
|
||||
}
|
||||
|
||||
private static void BodyTypeChanged(
|
||||
EntityUid uid,
|
||||
DisposalUnitComponent component,
|
||||
PhysicsBodyTypeChangedEvent args)
|
||||
private static void OnAnchored(EntityUid uid, DisposalUnitComponent component, AnchoredEvent args)
|
||||
{
|
||||
component.UpdateVisualState();
|
||||
}
|
||||
|
||||
private static void OnUnanchored(EntityUid uid, DisposalUnitComponent component, UnanchoredEvent args)
|
||||
{
|
||||
component.UpdateVisualState();
|
||||
component.TryEjectContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user