[MIRROR] Makes the edible component not runtime due to connect_loc_behalf when applied to turfs [MDB IGNORE] (#9877)

* Makes the edible component not runtime due to connect_loc_behalf when applied to turfs (#63232)

This makes it so it stops trying to use connect_loc_behalf if the parent of the edible component is a turf, just registering the signal normally instead, which should hopefully be the same functionality.

Runtimes are bad, and even if there's not really any relevant use of that proc in most cases, this is to future-proof things anyway.

* Makes the edible component not runtime due to connect_loc_behalf when applied to turfs

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-12-05 09:59:33 -05:00
committed by GitHub
co-authored by GoldenAlpharex
parent b978a701e6
commit ccf837ef8a
+7 -4
View File
@@ -72,10 +72,13 @@ Behavior that's still missing from this component that original food items had t
RegisterSignal(parent, COMSIG_EDIBLE_INGREDIENT_ADDED, .proc/edible_ingredient_added)
RegisterSignal(parent, COMSIG_OOZE_EAT_ATOM, .proc/on_ooze_eat)
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = .proc/on_entered,
)
AddComponent(/datum/component/connect_loc_behalf, parent, loc_connections)
if(!isturf(parent))
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = .proc/on_entered,
)
AddComponent(/datum/component/connect_loc_behalf, parent, loc_connections)
else
RegisterSignal(parent, COMSIG_ATOM_ENTERED, .proc/on_entered)
if(isitem(parent))
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/UseFromHand)