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