Also fixes robot/access() so that it will accept any one of the accesses
in req_access, instead of all - a much more likely use case.
This commit is contained in:
mwerezak
2014-06-03 19:17:00 -04:00
committed by ZomgPonies
parent f2721ca8a6
commit f92ce54cff
2 changed files with 11 additions and 4 deletions
@@ -12,6 +12,7 @@
braintype = "Robot"
lawupdate = 0
density = 1
req_access = list(access_engine, access_robotics)
// We need to keep track of a few module items so we don't need to do list operations
// every time we need them. These get set in New() after the module is chosen.
@@ -198,11 +199,15 @@
if(stat == 2)
user << "\red You swipe your ID card through [src], attempting to reboot it."
if(!config.allow_drone_spawn || emagged || health < -35) //It's dead, Dave.
user << "\red The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one."
return
if(!allowed(usr))
user << "\red Access denied."
return
user << "\red You swipe your ID card through [src], attempting to reboot it."
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
if(D.key && D.client)
@@ -220,6 +225,8 @@
if(allowed(usr))
shut_down()
else
user << "\red Access denied."
return
@@ -1050,9 +1050,9 @@
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
return 0
for(var/req in req_access)
if(!(req in I.access)) //doesn't have this access
return 0
return 1
if(req in I.access) //have one of the required accesses
return 1
return 0
/mob/living/silicon/robot/proc/updateicon()