mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-28 23:59:40 +01:00
[MIRROR] Ports TG Anomalies (#12105)
Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Guti
Cameron Lennox
parent
e7feab24f7
commit
7971b00c5d
@@ -0,0 +1,16 @@
|
||||
/proc/bitfield_to_list(bitfield = 0, list/wordlist)
|
||||
var/list/return_list = list()
|
||||
if(islist(wordlist))
|
||||
var/max = min(wordlist.len, 24)
|
||||
var/bit = 1
|
||||
for(var/i in 1 to max)
|
||||
if(bitfield & bit)
|
||||
return_list += wordlist[i]
|
||||
bit = bit << 1
|
||||
else
|
||||
for(var/bit_number = 0 to 23)
|
||||
var/bit = 1 << bit_number
|
||||
if(bitfield & bit)
|
||||
return_list += bit
|
||||
|
||||
return return_list
|
||||
Reference in New Issue
Block a user