Minor Performance Tweaks (#3265)

changes:

/datum/wires no longer has an (init) proc.
SMES wires now use timers instead of spawn.
Cleanables' random_icon_states list is now lazy. (eliminates ~4000 lists from dirt)
/obj/effect can no longer be pushed around by conveyor belts.
Lighting overlays are now explicitly prevented from being moved by conveyor belts.
This commit is contained in:
Lohikar
2017-08-11 22:57:57 +03:00
committed by Erki
parent e7e30d3ab5
commit fb73735ceb
7 changed files with 33 additions and 23 deletions
+8 -4
View File
@@ -45,8 +45,7 @@ var/const/SMES_WIRE_FAILSAFES = 16 // Cut to disable failsafes, mend to reenable
if(SMES_WIRE_RCON)
if(S.RCon)
S.RCon = 0
spawn(10)
S.RCon = 1
addtimer(CALLBACK(S, /obj/machinery/power/smes/buildable/.proc/reset_rcon), 10)
if(SMES_WIRE_INPUT)
S.toggle_input()
if(SMES_WIRE_OUTPUT)
@@ -56,5 +55,10 @@ var/const/SMES_WIRE_FAILSAFES = 16 // Cut to disable failsafes, mend to reenable
if(SMES_WIRE_FAILSAFES)
if(S.safeties_enabled)
S.safeties_enabled = 0
spawn(10)
S.safeties_enabled = 1
addtimer(CALLBACK(S, /obj/machinery/power/smes/buildable/.proc/reset_safeties), 10)
/obj/machinery/power/smes/buildable/proc/reset_safeties()
safeties_enabled = TRUE
/obj/machinery/power/smes/buildable/proc/reset_rcon()
RCon = TRUE
+4 -3
View File
@@ -17,8 +17,8 @@ var/list/wireColours = list("red", "blue", "green", "darkred", "orange", "brown"
var/wire_count = 0 // Max is 16
var/wires_status = 0 // BITFLAG OF WIRES
var/list/wires = list()
var/list/signallers = list()
var/list/wires
var/list/signallers
var/table_options = " align='center'"
var/row_options1 = " width='80px'"
@@ -27,7 +27,8 @@ var/list/wireColours = list("red", "blue", "green", "darkred", "orange", "brown"
var/window_y = 470
/datum/wires/New(var/atom/holder)
..()
wires = list()
signallers = list()
src.holder = holder
if(!istype(holder, holder_type))
CRASH("Our holder is null/the wrong type!")