From 15f9baa205d1d55466f8a8ef8fa9bdf51818b1bf Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Fri, 3 May 2024 03:32:10 -0700 Subject: [PATCH] Add containers doc --- .../space-station-14/core-tech/containers.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/en/space-station-14/core-tech/containers.md diff --git a/src/en/space-station-14/core-tech/containers.md b/src/en/space-station-14/core-tech/containers.md new file mode 100644 index 000000000..f9bed7ce6 --- /dev/null +++ b/src/en/space-station-14/core-tech/containers.md @@ -0,0 +1,19 @@ +# Containers + +Containers contain entities. Whether for inventory, backpacks, solutions, or actions. Containers contain lists of entities for usage in systems. + +## Review + +Any code that subscribes to container events should have a guard clause that checks for only the relevant containers. + +```cs +private void OnContainerModified(EntityUid uid, MicrowaveComponent component, ContainerModifiedMessage args) +{ + if (component.Storage != args.Container) + return; + + // Code continues ... +} +``` + +There have been problems in the past with [updating UI on unrelated containers (#27500)](https://github.com/space-wizards/space-station-14/pull/27500) \ No newline at end of file