Files
Bubberstation/code/datums/components
SyncIt21 fa7e4c9e0b _GetInverseTypeList() correctly returns all parent types (#77784)
## About The Pull Request

Fixes #77774
Fixes #77795

There is a problem with `/datum/component/proc/_GetInverseTypeList()`


e3a835b960/code/datums/components/_component.dm (L238-L245)

Notice after we store the parent type here

e3a835b960/code/datums/components/_component.dm (L241)

The value is lost inside our while loop here, we go to `current_type`
parent value before even adding it to the return list

e3a835b960/code/datums/components/_component.dm (L244)

And by the time we do add it to the list the parent type is lost and we
have the grand parent value instead

e3a835b960/code/datums/components/_component.dm (L245)

To test this call this proc with the value
`datum/component/plumbing/simple_supply`

**Expected result.**
`datum/component/plumbing/simple_supply` <----- The type of param passed
`datum/component/plumbing` <--------------------- The parent type of
param passed

**Actual result**
![Screenshot
(292)](https://github.com/tgstation/tgstation/assets/110812394/06603de6-109f-49bc-b9f2-22cd68dba560)


This crashes everything plumbing related.

The solution is simple just flip the while loop i.e. first add the
current value to the list then move to its parent type
```
while (current_type != /datum/component)
  . += current_type  <-----add parent value
  current_type = type2parent(current_type) <----then move up
```

So you get the correct list here
![Screenshot
(293)](https://github.com/tgstation/tgstation/assets/110812394/b3286ea3-4eb6-454b-ae84-b0b16390de86)


Broken by #77615 

## Changelog
🆑
fix: plumbing ducts connects to other plumbing machinery again
/🆑
2023-08-21 17:48:13 +03:00
..
2023-08-16 13:04:41 -06:00
2023-06-26 22:16:08 -06:00
2023-06-23 10:10:08 +02:00
2023-08-04 12:35:53 -06:00
2023-06-14 19:32:08 -07:00
2023-08-16 13:04:41 -06:00
2023-07-12 18:52:02 -06:00
2023-07-12 18:52:02 -06:00
2023-08-14 12:39:30 -06:00
2023-05-21 21:37:10 -06: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