Files
fulpstation/code/__HELPERS/string_numbers_lists.dm
SgtHunk 26a9e97803 August TGU: Wall leaning, ponies, cardboard IDs, smoothbore disablers and MUCH MORE! (#1032)
* this shit is like the ship of theseus bruh

* forgor dme

* updates maps

* some fixes just halfway through

* guhh

* ok

* whoops

* this one too

* that was such a stupid fix WHY

* fixes fulp ruin
2023-08-20 16:42:16 -07:00

20 lines
441 B
Plaintext

GLOBAL_LIST_EMPTY(string_numbers_lists)
/**
* Caches lists of numeric values.
*/
/datum/proc/string_numbers_list(list/values)
//Just to to be extra-safe. If you try to shove in text or paths, you deserve the runtime errors.
var/list/sum = 0
for(var/number in values)
sum += number
var/string_id = values.Join("-")
. = GLOB.string_numbers_lists[string_id]
if(.)
return .
return GLOB.string_numbers_lists[string_id] = values