Files
Bubberstation/code/datums/components
Bloop ce6364b082 Fixes crafting runtime (#95822)
## About The Pull Request

<details><summary> big purple dinosaur clogging up the runtime logs
</summary>

<img width="600" height="400" alt="v7N2LciICX"
src="https://github.com/user-attachments/assets/e9955159-caa2-4e86-862a-43c295bd31be"
/>

</details>

The issue is, the `contents` of items checked by `get_surroundings()`
are assumed to be `/obj/item` which is a false assumption. So this just
adds typechecking so that we don't runtime here and break crafting in
the vicinity.

This is a bad spot to runtime because it will stop materials from being
picked up by the crafting menu, preventing crafting from being possible.

<details><summary> before </summary> 

<img width="1786" height="162" alt="tracy-profiler_Fk2WSoYG5t"
src="https://github.com/user-attachments/assets/dc8f04a5-0f68-41d3-9e90-20e075ef68b4"
/>

</details>

<details><summary> after </summary> 

<img width="1767" height="176" alt="tracy-profiler_gHRDdRMMqo"
src="https://github.com/user-attachments/assets/a50ad290-153f-4ab6-9c6b-74fc43efaa4f"
/>

</details>

I profiled this both before and after these changes in the same exact
spot, surrounded by 70 electrical toolboxes, and the impact is
negligible (actually appears to be ~7.5% faster, interestingly).

## Why It's Good For The Game

## Changelog

🆑
fix: fixes an issue where raptor chicks and other non-items appearing in
item contents would prevent any personal crafting in the vicinity
/🆑
2026-04-22 13:03:04 +02:00
..
2026-04-22 13:03:04 +02:00
2025-10-02 18:15:25 +02:00
2025-12-20 12:33:10 -05:00
2025-09-07 09:24:34 +02:00
2025-10-07 20:28:59 +02:00
2025-12-28 19:57:42 +01: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 its 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