mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
ORM's smelt ores correctly when inserted by hand/bag (#92991)
## About The Pull Request - Fixes #92989 ## Changelog 🆑 fix: ORM's smelt ores correctly when inserted by hand/bag /🆑
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user