diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 1c0c7315150..d3d05077b7e 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -151,6 +151,28 @@ )) signal.send_to_receivers() +/obj/machinery/mineral/ore_redemption/base_item_interaction(mob/living/user, obj/item/tool, list/modifiers) + if(!materials.mat_container || panel_open || !powered()) + return ..() + + var/list/obj/item/stack/ore/gathered_ores = list() + if(istype(tool, /obj/item/stack/ore)) + gathered_ores += tool + else if(tool.atom_storage && !tool.atom_storage.locked) + tool.atom_storage.remove_type(/obj/item/stack/ore, src, check_adjacent = TRUE, user = user, inserted = gathered_ores) + if(!gathered_ores.len) + return ..() + + for(var/obj/item/stack/ore/gathered_ore as anything in gathered_ores) + var/obj/item/smelted_ore = gathered_ore.on_orm_collection() + if(isnull(smelted_ore)) + continue + + if(materials.insert_item(smelted_ore, ore_multiplier) <= 0) + unload_mineral(smelted_ore) + + return ITEM_INTERACT_SUCCESS + /obj/machinery/mineral/ore_redemption/pickup_item(datum/source, atom/movable/target, direction) if(QDELETED(target)) return @@ -170,14 +192,13 @@ //smelting the ore for(var/obj/item/stack/ore/gathered_ore as anything in ore_list) - var/obj/item/smelted_ore = gathered_ore.on_orm_collection(src) + var/obj/item/smelted_ore = gathered_ore.on_orm_collection() if(isnull(smelted_ore)) continue if(materials.insert_item(smelted_ore, ore_multiplier) <= 0) unload_mineral(smelted_ore) //if rejected unload - if(!console_notify_timer) // gives 5 seconds for a load of ores to be sucked up by the ORM before it sends out request console notifications. This should be enough time for most deposits that people make console_notify_timer = addtimer(CALLBACK(src, PROC_REF(send_console_message)), 5 SECONDS) diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 0e852e6e374..8582a1c3c86 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -49,9 +49,7 @@ * It can also be overriden for more specific behavior (for example, sand is smelted into glass beforehand because of different mats). */ /obj/item/stack/ore/proc/on_orm_collection() - if(isnull(refined_type)) - return null - return src + return isnull(refined_type) ? null : src /obj/item/stack/ore/welder_act(mob/living/user, obj/item/I) ..()