From 1e1b741ef9e53c2b2068e250644b60e9816be664 Mon Sep 17 00:00:00 2001 From: LightningIron Date: Mon, 13 Jul 2015 20:42:40 -0500 Subject: [PATCH 1/2] Fixes #9546. --- code/game/machinery/computer3/lapvend.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/game/machinery/computer3/lapvend.dm b/code/game/machinery/computer3/lapvend.dm index b2e84f1cd2..65d6610c23 100644 --- a/code/game/machinery/computer3/lapvend.dm +++ b/code/game/machinery/computer3/lapvend.dm @@ -215,6 +215,9 @@ 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 @@ -363,6 +366,9 @@ 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 From ddafefe9bd4a61717ba14ee998ddf8ee2944bb37 Mon Sep 17 00:00:00 2001 From: LightningIron Date: Mon, 13 Jul 2015 23:41:01 -0500 Subject: [PATCH 2/2] Vendors should no longer eat laptops if ID invalid. --- code/game/machinery/computer3/lapvend.dm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/computer3/lapvend.dm b/code/game/machinery/computer3/lapvend.dm index 65d6610c23..0c038b6c87 100644 --- a/code/game/machinery/computer3/lapvend.dm +++ b/code/game/machinery/computer3/lapvend.dm @@ -46,8 +46,8 @@ if(vendmode == 3) if(istype(W,/obj/item/weapon/card)) var/obj/item/weapon/card/I = W - reimburse(I) - vendmode = 0 + if(reimburse(I)) + vendmode = 0 if(vendmode == 0) if(istype(W, /obj/item/device/laptop)) var/obj/item/device/laptop/L = W @@ -368,19 +368,23 @@ 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 + 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 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 /obj/machinery/lapvend/proc/transfer_and_reimburse(var/datum/money_account/D) var/transaction_amount = total()