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:
SyncIt21
2025-09-17 00:58:58 +02:00
committed by GitHub
parent bd81d30f08
commit 5d6982bb08
2 changed files with 24 additions and 5 deletions
+23 -2
View File
@@ -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)
+1 -3
View File
@@ -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)
..()