From ccf837ef8a5a3c16d9b1e63830c5bb1565d5b7ee Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 5 Dec 2021 15:59:33 +0100 Subject: [PATCH] [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> --- code/datums/components/food/edible.dm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/datums/components/food/edible.dm b/code/datums/components/food/edible.dm index b92f7b8da63..89e8d223551 100644 --- a/code/datums/components/food/edible.dm +++ b/code/datums/components/food/edible.dm @@ -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)