Nano printers (computer component) will now refuse papers that are already written onto. (#19890)

Nano printers (computer component) will now refuse papers that are
already written onto.

Fixes #19889
This commit is contained in:
Fluffy
2024-09-21 11:24:46 +00:00
committed by GitHub
parent 99b8b251eb
commit fe905b2953
3 changed files with 100 additions and 19 deletions
@@ -32,15 +32,24 @@
return P
/obj/item/computer_hardware/nano_printer/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/paper))
if(stored_paper >= max_paper)
to_chat(user, SPAN_WARNING("You try to add \the [attacking_item] to the [src], but its paper bin is full."))
return
to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into [src]."))
qdel(attacking_item)
stored_paper++
else
..()
//We only care about papers here
if(!istype(attacking_item, /obj/item/paper))
return ..()
var/obj/item/paper/attacking_paper = attacking_item
//If the paper is already written onto, we can't add it to the printer
if(attacking_paper.free_space != initial(attacking_paper.free_space))
to_chat(user, SPAN_WARNING("You try to add \the [attacking_paper] to the [src], but the paper is written onto already."))
return
if(stored_paper >= max_paper)
to_chat(user, SPAN_WARNING("You try to add \the [attacking_paper] to the [src], but its paper bin is full."))
return
to_chat(user, SPAN_NOTICE("You insert \the [attacking_paper] into [src]."))
qdel(attacking_paper)
stored_paper++
/obj/item/computer_hardware/nano_printer/Destroy()
if(parent_computer?.nano_printer == src)