mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] Conversion many Globals to Managed Globals (Part 1) (#10665)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
06f0821bcf
commit
f7219329ca
@@ -150,7 +150,7 @@
|
||||
to_chat(usr,span_warning("The device beeps a warning that there is already a mind loaded!"))
|
||||
return
|
||||
|
||||
if(!target.mind || (target.mind.name in prevent_respawns))
|
||||
if(!target.mind || (target.mind.name in GLOB.prevent_respawns))
|
||||
to_chat(usr,span_warning("The device beeps a warning that the target isn't sentient."))
|
||||
return
|
||||
|
||||
|
||||
@@ -111,16 +111,16 @@
|
||||
return 1
|
||||
|
||||
/mob/living/simple_mob/humanoid/starhunter/trader/proc/credit_purchase(var/target as text)
|
||||
vendor_account.money += currently_vending.price
|
||||
GLOB.vendor_account.money += currently_vending.price
|
||||
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = target
|
||||
T.purpose = "Purchase of [currently_vending.item_name]"
|
||||
T.amount = "[currently_vending.price]"
|
||||
T.source_terminal = name
|
||||
T.date = current_date_string
|
||||
T.date = GLOB.current_date_string
|
||||
T.time = stationtime2text()
|
||||
vendor_account.transaction_log.Add(T)
|
||||
GLOB.vendor_account.transaction_log.Add(T)
|
||||
|
||||
/mob/living/simple_mob/humanoid/starhunter/trader/tgui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
@@ -228,7 +228,7 @@
|
||||
var/mob/living/carbon/human/H = usr
|
||||
var/obj/item/card/id/C = H.GetIdCard()
|
||||
|
||||
if(!vendor_account || vendor_account.suspended)
|
||||
if(!GLOB.vendor_account || GLOB.vendor_account.suspended)
|
||||
to_chat(usr, span_filter_notice("Vendor account offline. Unable to process transaction."))
|
||||
flick("[icon_state]-deny",src)
|
||||
vend_ready = TRUE
|
||||
@@ -358,14 +358,14 @@
|
||||
|
||||
// create entry in the purchaser's account log
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = "[vendor_account.owner_name] (via [name])"
|
||||
T.target_name = "[GLOB.vendor_account.owner_name] (via [name])"
|
||||
T.purpose = "Purchase of [currently_vending.item_name]"
|
||||
if(currently_vending.price > 0)
|
||||
T.amount = "([currently_vending.price])"
|
||||
else
|
||||
T.amount = "[currently_vending.price]"
|
||||
T.source_terminal = name
|
||||
T.date = current_date_string
|
||||
T.date = GLOB.current_date_string
|
||||
T.time = stationtime2text()
|
||||
customer_account.transaction_log.Add(T)
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null)
|
||||
my_index = i
|
||||
parent.active_pois[i] = src
|
||||
map_z[1] = parent.map_z[i]
|
||||
map_sectors["[parent.map_z[i]]"] = src // Pass ownership of z-level to child, probably hacky and terribad, also mandatory for using forceMove() on shuttle landmarks
|
||||
GLOB.map_sectors["[parent.map_z[i]]"] = src // Pass ownership of z-level to child, probably hacky and terribad, also mandatory for using forceMove() on shuttle landmarks
|
||||
break // Terminate loop
|
||||
if(!my_index) // No z-levels available
|
||||
var/confirm = tgui_alert(user, "\[REDACTED\] matrix at capacity; a bluespace link must be permanently severed to stabilize this anomaly. Continue?", "Are you sure?", list("No", "Yes"))
|
||||
@@ -204,7 +204,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null)
|
||||
if(my_index)
|
||||
parent.active_pois[my_index] = src
|
||||
map_z[1] = parent.map_z[my_index]
|
||||
map_sectors["[parent.map_z[my_index]]"] = src
|
||||
GLOB.map_sectors["[parent.map_z[my_index]]"] = src
|
||||
else // Something went wrong, ideally due to all relevant z-levels containing players.
|
||||
to_chat(user, "Unable to sever any bluespace link. All links likely contain living realspace entities.")
|
||||
return
|
||||
@@ -251,7 +251,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
map_sectors["[parent.map_z[my_index]]"] = parent // Pass ownership back to parent.
|
||||
GLOB.map_sectors["[parent.map_z[my_index]]"] = parent // Pass ownership back to parent.
|
||||
parent.active_pois[my_index] = null
|
||||
if(!LAZYLEN(map_z)) // If this is 0, how did we get this far?
|
||||
log_and_message_admins("Dynamic overmap POI attempted to unload without a linked z-level.")
|
||||
@@ -292,7 +292,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null)
|
||||
destroy_poi()
|
||||
else
|
||||
if(parent && (parent.active_pois.len >= my_index) && (parent.map_z.len >= my_index) && (my_index > 0)) // Unless vars are turbofucked.
|
||||
map_sectors["[parent.map_z[my_index]]"] = parent
|
||||
GLOB.map_sectors["[parent.map_z[my_index]]"] = parent
|
||||
parent.active_pois[my_index] = null
|
||||
if(parent)
|
||||
parent.all_children.Remove(src)
|
||||
@@ -305,7 +305,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null)
|
||||
// Make sure we reassign our z_level to the parent if one exists and somehow this gets called.
|
||||
/obj/effect/overmap/visitable/dynamic/poi/unregister_z_levels()
|
||||
if(parent && LAZYLEN(map_z))
|
||||
map_sectors["[map_z[1]]"] = parent
|
||||
GLOB.map_sectors["[map_z[1]]"] = parent
|
||||
map_z = null
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user