Refactor fax machine attackby to item_interaction (#96640)

This commit is contained in:
Roxy
2026-06-25 14:48:30 +02:00
committed by GitHub
parent 8525920dde
commit 7511c84352
+17 -14
View File
@@ -216,20 +216,23 @@ GLOBAL_VAR_INIT(fax_autoprinting, FALSE)
fax_name = new_fax_name
return ITEM_INTERACT_SUCCESS
/obj/machinery/fax/attackby(obj/item/item, mob/user, list/modifiers, list/attack_modifiers)
if (jammed && clear_jam(item, user))
return
if (panel_open)
if (is_wire_tool(item))
wires.interact(user)
return
if (can_load_item(item))
if (!loaded_item_ref?.resolve())
loaded_item_ref = WEAKREF(item)
item.forceMove(src)
update_appearance()
return
return ..()
/obj/machinery/fax/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(user.combat_mode)
return ITEM_INTERACT_SKIP_TO_ATTACK
if(jammed && clear_jam(tool, user))
return ITEM_INTERACT_SUCCESS
if(panel_open && is_wire_tool(tool))
wires.interact(user)
return ITEM_INTERACT_SUCCESS
if(can_load_item(tool))
if(loaded_item_ref?.resolve())
balloon_alert(user, "item already loaded!")
return ITEM_INTERACT_BLOCKING
loaded_item_ref = WEAKREF(tool)
tool.forceMove(src)
update_appearance()
return ITEM_INTERACT_SUCCESS
return NONE
/**
* Attempts to clean out a jammed machine using a passed item.