Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds access restrictions to ordering through the cargo console #4193

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions code/modules/cargo/orderconsole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,13 @@
rank = "Silicon"

var/datum/bank_account/account
//monkestation edit start: Helps prevent cargo mass ordering guns
var/mob/living/living_user = usr
var/obj/item/card/id/id_card = living_user.get_idcard(TRUE)
var/list/access = id_card.GetAccess()
if(self_paid && isliving(usr))
var/mob/living/living_user = usr
var/obj/item/card/id/id_card = living_user.get_idcard(TRUE)
//var/mob/living/living_user = usr
//var/obj/item/card/id/id_card = living_user.get_idcard(TRUE)
if(!istype(id_card))
say("No ID card detected.")
return
Expand All @@ -227,11 +231,11 @@
if(!istype(account))
say("Invalid bank account.")
return
var/list/access = id_card.GetAccess()
if(pack.access_view && !(pack.access_view in access))
say("[id_card] lacks the requisite access for this purchase.")
return

//var/list/access = id_card.GetAccess()
if(pack.access_view && (!(pack.access_view in access) && !(ACCESS_COMMAND in access))) //Let's members of command order without restrictions
say("[id_card] lacks the requisite access for this purchase.")
return
//monkestation edit end
var/reason = ""
if(requestonly && !self_paid)
reason = tgui_input_text(usr, "Reason", name)
Expand Down
Loading