mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
Renames flatten_list proc to assoc_to_values (#93453)
## About The Pull Request `/proc/flatten_list()` -> `/proc/assoc_to_values()`, also changes the code doc to mirror the language of `assoc_to_keys()`'s code doc ## Why It's Good For The Game Having a proc called `assoc_to_keys` that takes an associative list and returns a list of the keys, and also having a proc that takes an associative list and returns a list of the values, and the latter not being called `assoc_to_values` is very funny ## Changelog 🆑 code: renamed flatten_list proc to assoc_to_values /🆑 --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
/datum/smite/retcon/proc/delete_bank_account(mob/living/target)
|
||||
var/name = target.real_name
|
||||
var/account_list = flatten_list(SSeconomy.bank_accounts_by_id)
|
||||
var/account_list = assoc_to_values(SSeconomy.bank_accounts_by_id)
|
||||
for(var/datum/bank_account/account in account_list)
|
||||
if(account.account_holder == name)
|
||||
qdel(account)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
if(!islist(victim_hiddenprints))
|
||||
victim_hiddenprints = list()
|
||||
|
||||
var/list/hiddenprints = flatten_list(victim_hiddenprints)
|
||||
var/list/hiddenprints = assoc_to_values(victim_hiddenprints)
|
||||
list_clear_nulls(hiddenprints)
|
||||
|
||||
if(!length(hiddenprints))
|
||||
|
||||
@@ -540,7 +540,7 @@
|
||||
/datum/heretic_knowledge/ultimate/on_research(mob/user, datum/antagonist/heretic/our_heretic)
|
||||
. = ..()
|
||||
var/total_points = 0
|
||||
for(var/datum/heretic_knowledge/knowledge as anything in flatten_list(our_heretic.researched_knowledge))
|
||||
for(var/datum/heretic_knowledge/knowledge as anything in assoc_to_values(our_heretic.researched_knowledge))
|
||||
total_points += knowledge.cost
|
||||
|
||||
log_heretic_knowledge("[key_name(user)] gained knowledge of their final ritual at [gameTimestamp()]. \
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
/datum/hallucination/delusion/Destroy()
|
||||
if(!QDELETED(hallucinator) && LAZYLEN(delusions))
|
||||
hallucinator.client?.images -= flatten_list(delusions)
|
||||
hallucinator.client?.images -= assoc_to_values(delusions)
|
||||
LAZYNULL(delusions)
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#define HAS_SCREEN_OVERLAY(mob, type) (locate(type) in flatten_list(mob.screens))
|
||||
#define HAS_SCREEN_OVERLAY(mob, type) (locate(type) in assoc_to_values(mob.screens))
|
||||
#define HAS_CLIENT_COLOR(mob, type) (locate(type) in mob.client_colours)
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/datum/unit_test/valid_dna_infusion
|
||||
|
||||
/datum/unit_test/valid_dna_infusion/Run()
|
||||
for(var/datum/infuser_entry/infuser_entry as anything in flatten_list(GLOB.infuser_entries))
|
||||
for(var/datum/infuser_entry/infuser_entry as anything in assoc_to_values(GLOB.infuser_entries))
|
||||
for(var/input_type in infuser_entry.input_obj_or_mob)
|
||||
if(ispath(input_type, /mob/living))
|
||||
continue
|
||||
@@ -35,7 +35,7 @@
|
||||
/datum/infuser_entry/fly,
|
||||
))
|
||||
// Fetch the globally instantiated DNA Infuser entries.
|
||||
for(var/datum/infuser_entry/infuser_entry as anything in flatten_list(GLOB.infuser_entries))
|
||||
for(var/datum/infuser_entry/infuser_entry as anything in assoc_to_values(GLOB.infuser_entries))
|
||||
var/output_organs = infuser_entry.output_organs
|
||||
var/mob/living/carbon/human/lab_rat = allocate(/mob/living/carbon/human/consistent)
|
||||
var/list/obj/item/organ/inserted_organs = list()
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
TEST_ASSERT_NOTNULL(offer_guy.has_status_effect(/datum/status_effect/offering/no_item_received/high_five), \
|
||||
"Offerer doesn't have the high five offer status effect after offering (giving) to takers nearby")
|
||||
|
||||
var/atom/movable/screen/alert/give/highfive/alert_to_click = locate() in flatten_list(take_guy.alerts)
|
||||
var/atom/movable/screen/alert/give/highfive/bystander_alert_we_dont_click = locate() in flatten_list(random_bystander.alerts)
|
||||
var/atom/movable/screen/alert/give/highfive/alert_to_click = locate() in assoc_to_values(take_guy.alerts)
|
||||
var/atom/movable/screen/alert/give/highfive/bystander_alert_we_dont_click = locate() in assoc_to_values(random_bystander.alerts)
|
||||
TEST_ASSERT_NOTNULL(alert_to_click, "Taker had no alert to click to accept the high five offer")
|
||||
TEST_ASSERT_NOTNULL(bystander_alert_we_dont_click, "Bystander had no alert from the high fiver offer")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user