mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Fix vulnerabilities in air alarm and APC, fix mitochondria log
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user