Fixes two newmalf-related issues

- Fixes APC runtime. I am an idiot. I know.
- Fixes potentional power issue with AI powersupply object, caused by AI having more than one powersupply. This sometimes caused AI to use 100kW instead of 50kW
This commit is contained in:
Atlantis
2015-05-29 12:23:39 +02:00
parent e663a1c602
commit 477204e8c8
2 changed files with 4 additions and 4 deletions
+2
View File
@@ -246,6 +246,8 @@ var/list/ai_verbs_default = list(
if(!powered_ai || powered_ai.stat & DEAD)
qdel()
return
if(powered_ai.psupply != src) // For some reason, the AI has different powersupply object. Delete this one, it's no longer needed.
qdel(src)
if(powered_ai.APU_power)
use_power = 0
return
+2 -4
View File
@@ -159,10 +159,8 @@
stat |= MAINT
src.update_icon()
/obj/machinery/power/apc/initialize()
..()
/obj/machinery/power/apc/Destroy()
src.update()
area.apc = null
area.power_light = 0
area.power_equip = 0
@@ -179,7 +177,7 @@
terminal = null
// 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
..()