[MIRROR] The CE can now buy the BYOS (#5079)

* The CE can now buy the BYOS (#58389)

* The CE can now buy the BYOS

* aaa

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-04-22 01:27:04 +01:00
committed by GitHub
co-authored by Mothblocks Gandalf
parent 829dd37a8c
commit 4440140319
9 changed files with 85 additions and 30 deletions
+1 -1
View File
@@ -452,7 +452,7 @@ GLOBAL_LIST_EMPTY(the_station_areas)
var/datum/map_template/shuttle/S = new shuttle_type()
if(unbuyable.Find(S.mappath))
S.can_be_bought = FALSE
S.who_can_purchase = null
shuttle_templates[S.shuttle_id] = S
map_templates[S.shuttle_id] = S
+14
View File
@@ -59,6 +59,9 @@ SUBSYSTEM_DEF(shuttle)
/// A listing of previously delivered supply packs
var/list/orderhistory = list()
/// A list of job accesses that are able to purchase any shuttles
var/list/has_purchase_shuttle_access
var/list/hidden_shuttle_turfs = list() //all turfs hidden from navigation computers associated with a list containing the image hiding them and the type of the turf they are pretending to be
var/list/hidden_shuttle_turf_images = list() //only the images from the above list
@@ -103,6 +106,7 @@ SUBSYSTEM_DEF(shuttle)
supply_packs[pack.id] = pack
initial_load()
has_purchase_shuttle_access = init_has_purchase_shuttle_access()
if(!arrivals)
WARNING("No /obj/docking_port/mobile/arrivals placed on the map!")
@@ -964,3 +968,13 @@ SUBSYSTEM_DEF(shuttle)
var/set_purchase = alert(usr, "Do you want to also disable shuttle purchases/random events that would change the shuttle?", "Butthurt Admin Prevention", "Yes, disable purchases/events", "No, I want to possibly get owned")
if(set_purchase == "Yes, disable purchases/events")
SSshuttle.shuttle_purchased = SHUTTLEPURCHASE_FORCED
/datum/controller/subsystem/shuttle/proc/init_has_purchase_shuttle_access()
var/list/has_purchase_shuttle_access = list()
for (var/shuttle_id in SSmapping.shuttle_templates)
var/datum/map_template/shuttle/shuttle_template = SSmapping.shuttle_templates[shuttle_id]
if (!isnull(shuttle_template.who_can_purchase))
has_purchase_shuttle_access |= shuttle_template.who_can_purchase
return has_purchase_shuttle_access