mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
Cannot use departmental budget cards as source of credit withdraw (#76113)
Currently you can put cargo's budget card into your PDA, go into NT Pay and send over the budget to any pay token you want including yours. This just adds a check to ensure you aren't using that kind of card as withdrawal source.
This commit is contained in:
@@ -205,7 +205,7 @@
|
||||
if(!istype(id_card))
|
||||
say("No ID card detected.")
|
||||
return
|
||||
if(istype(id_card, /obj/item/card/id/departmental_budget))
|
||||
if(IS_DEPARTMENTAL_CARD(id_card))
|
||||
say("The [src] rejects [id_card].")
|
||||
return
|
||||
account = id_card.registered_account
|
||||
|
||||
@@ -132,12 +132,12 @@
|
||||
var/reason_to = "Transfer: From [from.account_holder]"
|
||||
var/reason_from = "Transfer: To [account_holder]"
|
||||
|
||||
if(istype(from, /datum/bank_account/department))
|
||||
if(IS_DEPARTMENTAL_ACCOUNT(from))
|
||||
reason_to = "Nanotrasen: Salary"
|
||||
reason_from = ""
|
||||
|
||||
if(transfer_reason)
|
||||
reason_to = istype(src, /datum/bank_account/department) ? "" : transfer_reason
|
||||
reason_to = IS_DEPARTMENTAL_ACCOUNT(src) ? "" : transfer_reason
|
||||
reason_from = transfer_reason
|
||||
|
||||
adjust_money(amount, reason_to)
|
||||
@@ -268,7 +268,7 @@
|
||||
department_id = dep_id
|
||||
account_balance = budget
|
||||
account_holder = SSeconomy.department_accounts[dep_id]
|
||||
SSeconomy.generated_accounts += src
|
||||
SSeconomy.departmental_accounts += src
|
||||
|
||||
/datum/bank_account/remote // Bank account not belonging to the local station
|
||||
add_to_accounts = FALSE
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
if(!istype(id_card))
|
||||
computer.say("No ID card detected.")
|
||||
return
|
||||
if(istype(id_card, /obj/item/card/id/departmental_budget))
|
||||
if(IS_DEPARTMENTAL_CARD(id_card))
|
||||
computer.say("[id_card] cannot be used to make purchases.")
|
||||
return
|
||||
account = id_card.registered_account
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
/datum/computer_file/program/nt_pay/ui_act(action, list/params, datum/tgui/ui)
|
||||
switch(action)
|
||||
if("Transaction")
|
||||
if(IS_DEPARTMENTAL_ACCOUNT(current_user))
|
||||
return to_chat(usr, span_notice("The app is unable to withdraw from that card."))
|
||||
|
||||
token = params["token"]
|
||||
money_to_send = params["amount"]
|
||||
var/datum/bank_account/recipient
|
||||
|
||||
Reference in New Issue
Block a user