fish-station/Content.Server/_Sunrise/Nesting/NestingSystem.cs
banumbas 397c2620f2
Резоми (#2739)
Co-authored-by: pofitlo <kuzminvladislav237@gmail.com>
Co-authored-by: Rinary <rinary.super@gmail.com>
Co-authored-by: Matthew Herber <matthewherber@sbcglobal.net>
Co-authored-by: Cerzix <123toy@web.de>
Co-authored-by: Citrea_Lingua <citrea.lingua@gmx.net>
Co-authored-by: Salem <Enderblaze03@gmail.com>
Co-authored-by: pxc1984 <igor.mamaev1@gmail.com>
2025-09-26 23:37:33 +03:00

27 lines
781 B
C#

using Content.Shared._Sunrise.Nesting;
using Robust.Shared.Containers;
namespace Content.Server._Sunrise.Nesting;
public sealed partial class NestingSystem : SharedNestingSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NestingContainerComponent, EntRemovedFromContainerMessage>(OnEntityRemoved);
}
private void OnEntityRemoved(EntityUid uid,
NestingContainerComponent component,
EntRemovedFromContainerMessage args)
{
if (args.Container.ID != BaseStorageId)
return;
if (!TryComp<NestingMobComponent>(args.Entity, out var nestingComponent))
return;
nestingComponent.InContainer = false;
Dirty(args.Entity, nestingComponent);
}
}