Don't use get_area proc, introduce myArea variable.

Conflicts:
	code/modules/power/power.dm
This commit is contained in:
ESwordTheCat
2014-04-20 08:46:59 +08:00
committed by ZomgPonies
parent f9a773c84d
commit b332bc7dec
3 changed files with 21 additions and 6 deletions
+6 -2
View File
@@ -54,12 +54,16 @@
// increment the power usage stats for an area
/obj/machinery/proc/use_power(var/amount, var/chan = -1, var/autocalled = 0) // defaults to power_channel
var/area/A = src.loc.loc // make sure it's in an area
/obj/machinery/proc/use_power(var/amount, var/chan = -1, var/autocalled = 0) // defaults to power_channel) // defaults to power_channel
var/area/A = src.myArea
if(!A || !isarea(A) || !A.master)
return
if(chan == -1)
chan = power_channel
A.master.use_power(amount, chan)
if(!autocalled)
A.master.powerupdate = 2 // Decremented by 2 each GC tick, since it's not auto power change we're going to update power twice.