-Added a logging message for a node having a null powernet.

-Misc stuff.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5475 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2013-01-06 00:08:51 +00:00
parent 49b6e1c64f
commit e4478711e4
2 changed files with 12 additions and 8 deletions
+10 -4
View File
@@ -230,7 +230,8 @@
i=1
while(i<=nodes.len)
var/obj/machinery/power/Node = nodes[i]
if(Node) Node.powernet = null
if(Node)
Node.powernet = null
i++
// remove the cut cable from the network
@@ -312,7 +313,7 @@
var/numapc = 0
if(nodes) // Added to fix a bad list bug -- TLE
if(nodes && nodes.len) // Added to fix a bad list bug -- TLE
for(var/obj/machinery/power/terminal/term in nodes)
if( istype( term.master, /obj/machinery/power/apc ) )
numapc++
@@ -323,8 +324,13 @@
netexcess = avail - load
if( netexcess > 100) // if there was excess power last cycle
for(var/obj/machinery/power/smes/S in nodes) // find the SMESes in the network
S.restore() // and restore some of the power that was used
if(nodes && nodes.len)
for(var/obj/machinery/power/smes/S in nodes) // find the SMESes in the network
if(S.powernet == src)
S.restore() // and restore some of the power that was used
else
error("[S.name] (\ref[S]) had a [S.powernet ? "different (\ref[S.powernet])" : "null"] powernet to our powernet (\ref[src]).")
nodes.Remove(S)
/datum/powernet/proc/get_electrocute_damage()
switch(avail)/*
+2 -4
View File
@@ -119,10 +119,7 @@
if(last_disp != chargedisplay() || last_chrg != charging || last_onln != online)
updateicon()
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
src.interact(M)
AutoUpdateAI(src)
updateDialog()
return
// called after all power processes are finished
@@ -367,3 +364,4 @@
return rate
#undef SMESRATE