mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 07:22:42 +00:00
Too remove potential excessive garbage collection per tick. We will be reusing lists for overlays instead of deleting and creating them.
the .Cut() proc on a list will empty a list by default. This also will set the len to 0. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5465 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -2077,7 +2077,7 @@
|
||||
if(F.z == 1)
|
||||
F.name = initial(F.name)
|
||||
F.desc = initial(F.desc)
|
||||
F.overlays = null
|
||||
F.overlays.Cut()
|
||||
F.lava = 0
|
||||
F.update_icon()
|
||||
floorIsLava = 0
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(a_left)
|
||||
overlays += "[a_left.icon_state]_left"
|
||||
for(var/O in a_left.attached_overlays)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
attached_overlays = list()
|
||||
if(on)
|
||||
overlays += "infrared_on"
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
attached_overlays = list()
|
||||
if(timing)
|
||||
overlays += "prox_timing"
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
attached_overlays = list()
|
||||
if(timing)
|
||||
overlays += "timer_timing"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
/obj/item/clothing/gloves/update_icon()
|
||||
..()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(wired)
|
||||
overlays += "gloves_wire"
|
||||
if(cell)
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message("[user] takes [I] out of [src]", "You take [I] out of [src].",\
|
||||
"You hear someone rustle around in a plastic bag, and remove something.")
|
||||
overlays = null //remove the overlays
|
||||
overlays.Cut() //remove the overlays
|
||||
user.put_in_hands(I)
|
||||
w_class = 1
|
||||
icon_state = "evidenceobj"
|
||||
|
||||
@@ -408,7 +408,7 @@ commented out in r5061, I left it because of the shroom thingies
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays()
|
||||
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
|
||||
src.overlays += image('icons/turf/walls.dmi', "rock_side_n")
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
/mob/living/carbon/alien/humanoid/queen/large/update_icons()
|
||||
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
|
||||
update_hud() //TODO: remove the need for this to be here
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(lying)
|
||||
if(resting) icon_state = "queen_sleep"
|
||||
else icon_state = "queen_l"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/mob/living/carbon/alien/humanoid/update_icons()
|
||||
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
|
||||
update_hud() //TODO: remove the need for this to be here
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(lying)
|
||||
if(resting) icon_state = "alien[caste]_sleep"
|
||||
else icon_state = "alien[caste]_l"
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = ui_style
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
@@ -131,7 +131,7 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
|
||||
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
|
||||
update_hud() //TODO: remove the need for this
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
|
||||
if(lying) //can't be cloaked when lying. (for now)
|
||||
icon = lying_icon
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = ui_style
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/mob/living/carbon/monkey/update_icons()
|
||||
update_hud()
|
||||
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(lying)
|
||||
icon_state = "monkey0"
|
||||
for(var/image/I in overlays_lying)
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
|
||||
mymob.zone_sel.overlays = null
|
||||
mymob.zone_sel.overlays.Cut()
|
||||
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
@@ -761,26 +761,26 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/updateicon()
|
||||
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(stat == 0)
|
||||
overlays += "eyes"
|
||||
if(icon_state == "robot")
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += "eyes-standard"
|
||||
if(icon_state == "toiletbot")
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += "eyes-toiletbot"
|
||||
if(icon_state == "bloodhound")
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += "eyes-bloodhound"
|
||||
if(icon_state =="landmate")
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += "eyes-landmate"
|
||||
if(icon_state =="mopgearrex")
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += "eyes-mopgearrex"
|
||||
if(icon_state =="Miner")
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += "eyes-Miner"
|
||||
else
|
||||
overlays -= "eyes"
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
else
|
||||
return
|
||||
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += image('icons/mob/zone_sel.dmi', "[selecting]")
|
||||
|
||||
return
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/clipboard/update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(toppaper)
|
||||
overlays += toppaper.icon_state
|
||||
overlays += toppaper.overlays
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
icon_state = "folder_white"
|
||||
|
||||
/obj/item/weapon/folder/update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(contents.len)
|
||||
overlays += "folder_paper"
|
||||
return
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
info = null
|
||||
stamps = null
|
||||
stamped = list()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
updateinfolinks()
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ proc/cardinalrange(var/center)
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
for(var/direction in alldirs)
|
||||
var/machine = locate(/obj/machinery, get_step(loc, direction))
|
||||
if((istype(machine, /obj/machinery/am_shielding) && machine:control_unit == control_unit)||(istype(machine, /obj/machinery/power/am_control_unit) && machine == control_unit))
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
// also add overlays for indicator lights
|
||||
/obj/machinery/power/apc/update_icon()
|
||||
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(opened)
|
||||
var/basestate = "apc[ cell ? "2" : "1" ]" // if opened, show cell if it's inserted
|
||||
if (opened==1)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
updateicon()
|
||||
|
||||
/obj/item/weapon/cell/proc/updateicon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
|
||||
if(charge < 0.01)
|
||||
return
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
/obj/machinery/power/generator/proc/updateicon()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
else
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
|
||||
if(lastgenlev != 0)
|
||||
overlays += image('icons/obj/power.dmi', "teg-op[lastgenlev]")
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
/obj/machinery/power/generator_type2/proc/updateicon()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
else
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
|
||||
if(lastgenlev != 0)
|
||||
overlays += image('icons/obj/power.dmi', "teg-op[lastgenlev]")
|
||||
|
||||
@@ -129,7 +129,7 @@ var/global/list/rad_collectors = list()
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/update_icons()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(P)
|
||||
overlays += image('icons/obj/singularity.dmi', "ptank")
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
|
||||
@@ -34,7 +34,7 @@ field_generator power level display
|
||||
|
||||
|
||||
/obj/machinery/field_generator/update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(!active)
|
||||
if(warming_up)
|
||||
overlays += "+a[warming_up]"
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
|
||||
/obj/machinery/power/smes/proc/updateicon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN) return
|
||||
|
||||
overlays += image('icons/obj/power.dmi', "smes-op[online]")
|
||||
|
||||
@@ -101,7 +101,7 @@ var/list/solars_list = list()
|
||||
|
||||
/obj/machinery/power/solar/update_icon()
|
||||
..()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN)
|
||||
overlays += image('icons/obj/power.dmi', icon_state = "solar_panel-b", layer = FLY_LAYER)
|
||||
else
|
||||
@@ -306,14 +306,14 @@ var/list/solars_list = list()
|
||||
/obj/machinery/power/solar_control/update_icon()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
return
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "c_unpowered"
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
return
|
||||
icon_state = "solar"
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(cdir > 0)
|
||||
overlays += image('icons/obj/computer.dmi', "solcon-o", FLY_LAYER, angle2dir(cdir))
|
||||
return
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
/obj/machinery/compressor/process()
|
||||
if(!starter)
|
||||
return
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(!turbine)
|
||||
@@ -113,7 +113,7 @@
|
||||
/obj/machinery/power/turbine/process()
|
||||
if(!compressor.starter)
|
||||
return
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(!compressor)
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
update_charge()
|
||||
update_reactor()
|
||||
update_mode()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
M.monkeyizing = 1
|
||||
M.canmove = 0
|
||||
M.icon = null
|
||||
M.overlays = null
|
||||
M.overlays.Cut()
|
||||
M.invisibility = 101
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot))
|
||||
|
||||
@@ -844,7 +844,7 @@ datum
|
||||
if(volume >= 5)
|
||||
if(istype(T, /turf/simulated/wall))
|
||||
T:thermite = 1
|
||||
T.overlays = null
|
||||
T.overlays.Cut()
|
||||
T.overlays = image('icons/effects/effects.dmi',icon_state = "thermite")
|
||||
return
|
||||
|
||||
@@ -1034,7 +1034,7 @@ datum
|
||||
O.clean_blood()
|
||||
reaction_turf(var/turf/T, var/volume)
|
||||
if(volume >= 1)
|
||||
T.overlays = null
|
||||
T.overlays.Cut()
|
||||
T.clean_blood()
|
||||
for(var/obj/effect/decal/cleanable/C in src)
|
||||
del(C)
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
update_icon()
|
||||
var/rounded_vol = round(reagents.total_volume,5)
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(ismob(loc))
|
||||
var/injoverlay
|
||||
switch(mode)
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
|
||||
// update the icon & overlays to reflect mode & status
|
||||
proc/update()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "disposal-broken"
|
||||
mode = 0
|
||||
|
||||
Reference in New Issue
Block a user