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
+1 -1
View File
@@ -267,7 +267,7 @@ datum/controller/game_controller/proc/process()
continue
machines = machines - Machinery
Machinery.removeAtProcessing()
/datum/controller/game_controller/proc/processObjects()
for (var/obj/Object in processing_objects)
+14 -3
View File
@@ -112,16 +112,27 @@ Class Procs:
var/global/gl_uid = 1
var/custom_aghost_alerts=0
var/panel_open = 0
var/myArea
/obj/machinery/New()
..()
addAtProcessing()
return ..()
/obj/machinery/proc/addAtProcessing()
myArea = loc.loc
machines += src
/obj/machinery/Destroy()
/obj/machinery/proc/removeAtProcessing()
myArea = null
machines -= src
/obj/machinery/Destroy()
if (src in machines)
removeAtProcessing()
..()
/obj/machinery/process()//If you dont use process or power why are you here
/obj/machinery/process() // If you dont use process or power why are you here
return PROCESS_KILL
/obj/machinery/emp_act(severity)
+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.