2021-05-30 23:30:44 +10:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Physics.Dynamics;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Doors
|
2021-05-30 23:30:44 +10:00
|
|
|
{
|
|
|
|
|
public abstract class SharedDoorSystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
SubscribeLocalEvent<SharedDoorComponent, PreventCollideEvent>(PreventCollision);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PreventCollision(EntityUid uid, SharedDoorComponent component, PreventCollideEvent args)
|
|
|
|
|
{
|
|
|
|
|
if (component.IsCrushing(args.BodyB.Owner))
|
|
|
|
|
{
|
|
|
|
|
args.Cancel();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|