Merge pull request #1673 from Citadel-Station-13/upstream-merge-28567
[MIRROR] Refactors PDA cartridge permissions
This commit is contained in:
@@ -1417,3 +1417,10 @@ GLOBAL_PROTECT(valid_HTTPSGet)
|
||||
mob_occupant = brain.brainmob
|
||||
|
||||
return mob_occupant
|
||||
|
||||
//counts the number of bits in Byond's 16-bit width field
|
||||
//in constant time and memory!
|
||||
/proc/BitCount(bitfield)
|
||||
var/temp = bitfield - ((bitfield>>1)&46811) - ((bitfield>>2)&37449) //0133333 and 0111111 respectively
|
||||
temp = ((temp + (temp>>3))&29127) % 63 //070707
|
||||
return temp
|
||||
|
||||
Reference in New Issue
Block a user