[FIX] Mining Vendor now spits ID on power_off (#21658)

* fix: Miner Vendor now spits ID on power_off
https://github.com/ss220-space/Paradise/pull/1317

* review fixes

* oops missed that

* Update code/modules/mining/machine_vending.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

---------

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
larentoun
2023-07-23 23:29:58 +01:00
committed by GitHub
co-authored by Ryan
parent dce69db910
commit becc10c50d
+12 -9
View File
@@ -93,13 +93,18 @@
)
prize_list["Extra"] = list() // Used in child vendors
/obj/machinery/mineral/equipment_vendor/proc/remove_id()
if(inserted_id)
inserted_id.forceMove(get_turf(src))
inserted_id = null
return TRUE
/obj/machinery/mineral/equipment_vendor/power_change()
if(!..())
return
. = ..()
update_icon(UPDATE_ICON_STATE)
if(inserted_id && !(stat & NOPOWER))
visible_message("<span class='notice'>The ID slot indicator light flickers on \the [src] as it spits out a card before powering down.</span>")
inserted_id.forceMove(loc)
if(. && inserted_id && (stat & NOPOWER))
visible_message("<span class='notice'>The ID slot indicator light flickers on [src] as it spits out a card before powering down.</span>")
remove_id()
/obj/machinery/mineral/equipment_vendor/update_icon_state()
if(has_power())
@@ -203,8 +208,7 @@
return
if(panel_open)
if(istype(I, /obj/item/crowbar))
if(inserted_id)
inserted_id.forceMove(loc) //Prevents deconstructing the ORM from deleting whatever ID was inside it.
remove_id()
default_deconstruction_crowbar(user, I)
return TRUE
if(istype(I, /obj/item/mining_voucher))
@@ -268,8 +272,7 @@
qdel(src)
/obj/machinery/mineral/equipment_vendor/Destroy()
if(inserted_id)
inserted_id.forceMove(loc)
remove_id()
return ..()