diff --git a/code/game/machinery/computer3/lapvend.dm b/code/game/machinery/computer3/lapvend.dm index 416472a31a..ac3e7e172c 100644 --- a/code/game/machinery/computer3/lapvend.dm +++ b/code/game/machinery/computer3/lapvend.dm @@ -38,16 +38,14 @@ /obj/machinery/lapvend/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(vendmode == 1) - if(istype(W, /obj/item/weapon/card)) - var/obj/item/weapon/card/I = W - scan_card(I) + var/obj/item/weapon/card/id/I = W.GetID() + + if(vendmode == 1 && I) + scan_id(I, W) + vendmode = 0 + if(vendmode == 3 && I) + if(reimburse_id(I, W)) vendmode = 0 - if(vendmode == 3) - if(istype(W,/obj/item/weapon/card)) - var/obj/item/weapon/card/I = W - if(reimburse(I)) - vendmode = 0 if(vendmode == 0) if(istype(W, /obj/item/device/laptop)) var/obj/item/device/laptop/L = W @@ -210,26 +208,24 @@ newlap.spawn_parts() -/obj/machinery/lapvend/proc/scan_card(var/obj/item/weapon/card/I) - if (istype(I, /obj/item/weapon/card/id)) - var/obj/item/weapon/card/id/C = I - visible_message("[usr] swipes a card through [src].") - var/datum/money_account/CH = get_account(C.associated_account_number) - if(!CH) - usr << "\icon[src]No valid account number is associated with this card." - return - if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) - if(vendor_account) - var/attempt_pin = input("Enter pin code", "Vendor transaction") as num - var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2) - if(D) - transfer_and_vend(D, C) - else - usr << "\icon[src]Unable to access account. Check security settings and try again." +/obj/machinery/lapvend/proc/scan_id(var/obj/item/weapon/card/id/C, var/obj/item/I) + visible_message("\The [usr] swipes \the [I] through \the [src].") + var/datum/money_account/CH = get_account(C.associated_account_number) + if(!CH) + usr << "\icon[src]No valid account number is associated with this card." + return + if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) + if(vendor_account) + var/attempt_pin = input("Enter pin code", "Vendor transaction") as num + var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2) + if(D) + transfer_and_vend(D, C) else usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support." else - transfer_and_vend(CH, C) + usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support." + else + transfer_and_vend(CH, C) // Transfers money and vends the laptop. @@ -361,30 +357,28 @@ -/obj/machinery/lapvend/proc/reimburse(var/obj/item/weapon/card/I) - if (istype(I, /obj/item/weapon/card/id)) - var/obj/item/weapon/card/id/C = I - visible_message("[usr] swipes a card through [src].") - var/datum/money_account/CH = get_account(C.associated_account_number) - if(!CH) - usr << "\icon[src]No valid account number is associated with this card." - return 0 - if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) - if(vendor_account) - var/attempt_pin = input("Enter pin code", "Vendor transaction") as num - var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2) - if(D) - transfer_and_reimburse(D) - return 1 - else - usr << "\icon[src]Unable to access account. Check security settings and try again." - return 0 +/obj/machinery/lapvend/proc/reimburse_id(var/obj/item/weapon/card/id/C, var/obj/item/I) + visible_message("\The [usr] swipes \the [I] through \the [src].") + var/datum/money_account/CH = get_account(C.associated_account_number) + if(!CH) + usr << "\icon[src]No valid account number is associated with this card." + return 0 + if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) + if(vendor_account) + var/attempt_pin = input("Enter pin code", "Vendor transaction") as num + var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2) + if(D) + transfer_and_reimburse(D) + return 1 else usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support." return 0 else - transfer_and_reimburse(CH) - return 1 + usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support." + return 0 + else + transfer_and_reimburse(CH) + return 1 /obj/machinery/lapvend/proc/transfer_and_reimburse(var/datum/money_account/D) var/transaction_amount = total() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index 2aa3e57185..a71851f9f2 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -66,11 +66,12 @@ src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet user.drop_item() if (W) W.forceMove(src.loc) - else if(istype(W, /obj/item/weapon/card/id)) + else if(W.GetID()) + var/obj/item/weapon/card/id/I = W.GetID() + if(src.broken) user << "It appears to be broken." return - var/obj/item/weapon/card/id/I = W if(!I || !I.registered_name) return if(src.allowed(user) || !src.registered_name || (istype(I) && (src.registered_name == I.registered_name))) //they can open all lockers, or nobody owns this, or they own this locker diff --git a/html/changelogs/neersighted-11486.yml b/html/changelogs/neersighted-11486.yml new file mode 100644 index 0000000000..8908354b58 --- /dev/null +++ b/html/changelogs/neersighted-11486.yml @@ -0,0 +1,5 @@ +author: neersighted +delete-after: True +changes: + - bugfix: "Laptop Vendors now accept ID Containers (PDA, Wallet, etc)." + - bugfix: "Personal Lockers now accept ID Containers (PDA, Wallet, etc)."