Fix vulnerabilities in air alarm and APC, fix mitochondria log

This commit is contained in:
Markolie
2015-02-08 17:07:55 +01:00
parent 37811366a8
commit c1b6bba1ec
5 changed files with 86 additions and 9 deletions
+29 -3
View File
@@ -805,6 +805,8 @@
if (user.stat && !isobserver(user))
user << "\red You must be conscious to use this [src]!"
return 0
if(stat & (NOPOWER|BROKEN))
return 0
if(!user.client)
return 0
if ( ! (istype(user, /mob/living/carbon/human) || \
@@ -849,36 +851,60 @@
user << "\red You momentarily forget how to use [src]."
return 0
return 1
/obj/machinery/power/apc/proc/is_authenticated(mob/user as mob)
if(isAI(user) || isrobot(user))
return 1
else
return !locked
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
if(!can_use(usr, 1))
return 0
return 0
if (href_list["lock"])
if(!is_authenticated(usr))
return
coverlocked = !coverlocked
else if (href_list["breaker"])
if(!is_authenticated(usr))
return
toggle_breaker()
else if (href_list["cmode"])
if(!is_authenticated(usr))
return
chargemode = !chargemode
if(!chargemode)
charging = 0
update_icon()
else if (href_list["eqp"])
if(!is_authenticated(usr))
return
var/val = text2num(href_list["eqp"])
equipment = setsubsystem(val)
update_icon()
update()
else if (href_list["lgt"])
if(!is_authenticated(usr))
return
var/val = text2num(href_list["lgt"])
lighting = setsubsystem(val)
update_icon()
update()
else if (href_list["env"])
if(!is_authenticated(usr))
return
var/val = text2num(href_list["env"])
environ = setsubsystem(val)
update_icon()
@@ -893,7 +919,7 @@
return 0
else if (href_list["overload"])
if(istype(usr, /mob/living/silicon))
if(istype(usr, /mob/living/silicon) && !aidisabled)
src.overload_lighting()
else if (href_list["malfhack"])
@@ -931,7 +957,7 @@
else if (href_list["toggleaccess"])
if(istype(usr, /mob/living/silicon))
if(emagged || (stat & (BROKEN|MAINT)))
if(emagged || aidisabled || (stat & (BROKEN|MAINT)))
usr << "The APC does not respond to the command."
else
locked = !locked