diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index cf5902cb0a..fd1ce21cc4 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -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 diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 5c1faf35e2..d1a29ba046 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -42,7 +42,7 @@ GLOBAL_LIST_EMPTY(PDAs) var/notehtml = "" var/notescanned = 0 // True if what is in the notekeeper was from a paper. var/cart = "" //A place to stick cartridge menu information - var/detonate = 1 // Can the PDA be blown up? + var/detonatable = TRUE // Can the PDA be blown up? var/hidden = 0 // Is the PDA hidden from the PDA list? var/emped = 0 @@ -153,31 +153,31 @@ GLOBAL_LIST_EMPTY(PDAs) dat += "
  • Messenger
  • " if (cartridge) - if (cartridge.access_clown) + if (cartridge.access & CART_CLOWN) dat += "
  • Honk Synthesizer
  • " dat += "
  • Sad Trombone
  • " - if (cartridge.access_manifest) + if (cartridge.access & CART_MANIFEST) dat += "
  • View Crew Manifest
  • " - if(cartridge.access_status_display) + if(cartridge.access & CART_STATUS_DISPLAY) dat += "
  • Set Status Display
  • " dat += "" - if (cartridge.access_engine) + if (cartridge.access & CART_ENGINE) dat += "

    Engineering Functions

    " dat += "" - if (cartridge.access_medical) + if (cartridge.access & CART_MEDICAL) dat += "

    Medical Functions

    " dat += "" - if (cartridge.access_security) + if (cartridge.access & CART_SECURITY) dat += "

    Security Functions

    " dat += "" - if(cartridge.access_quartermaster) + if(cartridge.access & CART_QUARTERMASTER) dat += "

    Quartermaster Functions:

    " dat += "