From ce6364b0829eaaefae3d54201194a83f1ff306b3 Mon Sep 17 00:00:00 2001
From: Bloop <13398309+vinylspiders@users.noreply.github.com>
Date: Wed, 22 Apr 2026 07:03:04 -0400
Subject: [PATCH] Fixes crafting runtime (#95822)
## About The Pull Request
big purple dinosaur clogging up the runtime logs
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.
before
after
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
:cl:
fix: fixes an issue where raptor chicks and other non-items appearing in
item contents would prevent any personal crafting in the vicinity
/:cl:
---
code/datums/components/crafting/crafting.dm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm
index a042bfe7a02..1a19b82c97b 100644
--- a/code/datums/components/crafting/crafting.dm
+++ b/code/datums/components/crafting/crafting.dm
@@ -180,7 +180,8 @@
for(var/obj/item/item in source.contents)
within_source += item
if(item.atom_storage)
- within_source += item.contents
+ for(var/obj/item/item_stored_within in item.contents)
+ within_source += item_stored_within
for(var/obj/item/item as anything in within_source)
if(!item.tool_behaviour)