Files
Bubberstation/code/datums/components
SkyratBot 37f63eee04 [MIRROR] Fixes a bug in signal unregistration code (#5822)
* Fixes a bug in signal unregistration code that was causing unrelated objects to lose their registration in a (#59116)

This was causing unrelated objects to lose their registration in a hyper rare case.

The process went something like:
when object foo is registered to something and object bar is registered to the same object with a different
signal it will remove foo's signal only when foo is the only one registered to the object with that signal
Why it's good for the game

This was breaking #58918 when blood wasn't qdel'd post test. I'm so happy I found this.
It's a rare case, so I doubt it'll effect a lot of things, but I can trust UnregisterSignal again, which is very nice.

* Fixes a bug in signal unregistration code

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2021-05-20 22:57:07 +01:00
..
2021-03-07 02:29:00 +00:00
2021-05-02 22:58:31 +01:00
2021-02-19 16:08:09 +00:00

Datum Component System (DCS)

Concept

Loosely adapted from /vg/. This is an entity component system for adding behaviours to datums when inheritance doesn't quite cut it. By using signals and events instead of direct inheritance, you can inject behaviours without hacky overloads. It requires a different method of thinking, but is not hard to use correctly. If a behaviour can have application across more than one thing. Make it generic, make it a component. Atom/mob/obj event? Give it a signal, and forward it's arguments with a SendSignal() call. Now every component that want's to can also know about this happening.

HackMD page for an introduction to the system as a whole.

See/Define signals and their arguments in __DEFINES\components.dm