Merge pull request #11316 from atlantiscze/apc-fix

Fixes #11149
This commit is contained in:
Zuhayr
2015-12-02 09:57:26 +10:30

View File

@@ -479,8 +479,6 @@
user << "<span class='warning'>There is nothing to secure.</span>"
return
update_icon()
else if(emagged)
user << "The interface is broken."
else
wiresexposed = !wiresexposed
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
@@ -625,8 +623,9 @@
qdel(W)
stat &= ~BROKEN
// Malf AI, removes the APC from AI's hacked APCs list.
if(hacker && hacker.hacked_apcs && src in hacker.hacked_apcs)
if(hacker && hacker.hacked_apcs && (src in hacker.hacked_apcs))
hacker.hacked_apcs -= src
hacker = null
if (opened==2)
opened = 1
update_icon()
@@ -749,7 +748,7 @@
return
var/list/data = list(
"locked" = locked,
"locked" = (locked && !emagged) ? 1 : 0,
"isOperating" = operating,
"externalPower" = main_status,
"powerCellStatus" = cell ? cell.percent() : null,
@@ -862,7 +861,7 @@
user << "<span class='danger'>\The [src] have AI control disabled!</span>"
return 0
else
if ((!in_range(src, user) || !istype(src.loc, /turf) || hacker)) // AI-hacked APCs cannot be controlled by other AIs, unlinked cyborgs or humans.
if (!in_range(src, user) || !istype(src.loc, /turf))
return 0
var/mob/living/carbon/human/H = user
if (istype(H))
@@ -881,7 +880,7 @@
if(!can_use(usr, 1))
return 1
if(!istype(usr, /mob/living/silicon) && locked)
if(!istype(usr, /mob/living/silicon) && (locked && !emagged))
// Shouldn't happen, this is here to prevent href exploits
usr << "You must unlock the panel to use this!"
return 1