diff --git a/code/datums/elements/bump_click.dm b/code/datums/elements/bump_click.dm index 15e83d787b4..6f7e3be66ea 100644 --- a/code/datums/elements/bump_click.dm +++ b/code/datums/elements/bump_click.dm @@ -17,7 +17,7 @@ ///Click with any item? var/allow_any = TRUE -/datum/element/bump_click/Attach(datum/target, list/tool_behaviours, list/tool_items, allow_unarmed = FALSE, allow_combat = FALSE, allow_any = FALSE) +/datum/element/bump_click/Attach(datum/target, list/tool_behaviours, list/tool_types, allow_unarmed = FALSE, allow_combat = FALSE, allow_any = FALSE) . = ..() if(!isatom(target) || isarea(target)) diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index ffa1bbe719d..dacff329ba3 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -37,8 +37,18 @@ M.Translate(-4, -4) transform = M icon = smooth_icon - var/static/list/behaviors = list(TOOL_MINING) - AddElement(/datum/element/bump_click, tool_behaviours = behaviors, allow_unarmed = TRUE) + +// Inlined version of the bump click element. way faster this way, the element's nice but it's too much overhead +/turf/closed/mineral/Bumped(atom/movable/bumped_atom) + . = ..() + if(!isliving(bumped_atom)) + return + + var/mob/living/bumping = bumped_atom + var/obj/item/held_item = bumping.get_active_held_item() + // !held_item exists to be nice to snow. the other bit is for pickaxes obviously + if(!held_item || held_item.tool_behaviour == TOOL_MINING) + INVOKE_ASYNC(bumping, /mob.proc/ClickOn, src) /turf/closed/mineral/proc/Spread_Vein() var/spreadChance = initial(mineralType.spreadChance)