mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01: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:
@@ -61,7 +61,7 @@
|
||||
else if(istype(W, /obj/item/weapon/wirecutters))
|
||||
user << "You cut the tag off the bodybag"
|
||||
src.name = "body bag"
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -682,7 +682,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
//EXTRA FUNCTIONS===================================
|
||||
|
||||
if (mode == 2||mode == 21)//To clear message overlays.
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
|
||||
if ((honkamt > 0) && (prob(60)))//For clown virus.
|
||||
honkamt--
|
||||
@@ -781,7 +781,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
L << "\icon[P] <b>Message from [src.owner] ([ownjob]), </b>\"[t]\" (<a href='byond://?src=\ref[P];choice=Message;skiprefresh=1;target=\ref[src]'>Reply</a>)"
|
||||
|
||||
log_pda("[usr] (PDA: [src.name]) sent \"[t]\" to [P.name]")
|
||||
P.overlays = null
|
||||
P.overlays.Cut()
|
||||
P.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
else
|
||||
U << "<span class='notice'>ERROR: Server isn't responding.</span>"
|
||||
|
||||
@@ -110,12 +110,12 @@
|
||||
|
||||
/obj/item/device/paicard/proc/removePersonality()
|
||||
src.pai = null
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
src.overlays += "pai-off"
|
||||
|
||||
/obj/item/device/paicard/proc/setEmotion(var/emotion)
|
||||
if(pai)
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
switch(emotion)
|
||||
if(1) src.overlays += "pai-happy"
|
||||
if(2) src.overlays += "pai-cat"
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
toggle = 1
|
||||
|
||||
/obj/item/device/transfer_valve/update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
underlays = null
|
||||
|
||||
if(!tank_one && !tank_two && !attached_device)
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
src.updateicon()
|
||||
|
||||
/obj/item/robot_parts/robot_suit/proc/updateicon()
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
if(src.l_arm)
|
||||
src.overlays += "l_arm+o"
|
||||
if(src.r_arm)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
usr << "You slice off [src]'s uneven chunks of aluminum and scorch marks."
|
||||
return
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(focus && focus.icon && focus.icon_state)
|
||||
overlays += icon(focus.icon,focus.icon_state)
|
||||
return
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/flamethrower/update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(igniter)
|
||||
overlays += "+igniter[status]"
|
||||
if(ptank)
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
/obj/item/weapon/tray/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
|
||||
// Drop all the things. All of them.
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
for(var/obj/item/I in carrying)
|
||||
I.loc = M.loc
|
||||
carrying.Remove(I)
|
||||
@@ -391,7 +391,7 @@
|
||||
foundtable = 1
|
||||
break
|
||||
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
|
||||
for(var/obj/item/I in carrying)
|
||||
I.loc = loc
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
emagged = 1
|
||||
src.overlays += image('icons/obj/storage.dmi', icon_sparking)
|
||||
sleep(6)
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
overlays += image('icons/obj/storage.dmi', icon_locking)
|
||||
locked = 0
|
||||
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
||||
@@ -225,7 +225,7 @@
|
||||
src.l_set = 1
|
||||
else if ((src.code == src.l_code) && (src.emagged == 0) && (src.l_set == 1))
|
||||
src.locked = 0
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
overlays += image('icons/obj/storage.dmi', icon_opened)
|
||||
src.code = null
|
||||
else
|
||||
@@ -233,7 +233,7 @@
|
||||
else
|
||||
if ((href_list["type"] == "R") && (src.emagged == 0) && (!src.l_setshort))
|
||||
src.locked = 1
|
||||
src.overlays = null
|
||||
src.overlays.Cut()
|
||||
src.code = null
|
||||
src.close(usr)
|
||||
else
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
usr << "<span class='warning'>This mob type can't use this verb.</span>"
|
||||
|
||||
/obj/structure/closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(!opened)
|
||||
icon_state = icon_closed
|
||||
if(welded)
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
usr << "<span class='warning'>This mob type can't use this verb.</span>"
|
||||
|
||||
/obj/structure/closet/secure_closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
if(!opened)
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
|
||||
@@ -211,10 +211,10 @@
|
||||
/obj/structure/closet/crate/secure/New()
|
||||
..()
|
||||
if(locked)
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += redlight
|
||||
else
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += greenlight
|
||||
|
||||
/obj/structure/closet/crate/rcd/New()
|
||||
@@ -287,7 +287,7 @@
|
||||
if (allowed(user))
|
||||
user << "<span class='notice'>You unlock [src].</span>"
|
||||
src.locked = 0
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += greenlight
|
||||
return
|
||||
else
|
||||
@@ -300,11 +300,11 @@
|
||||
if(istype(W, /obj/item/weapon/card) && src.allowed(user) && !locked && !opened && !broken)
|
||||
user << "<span class='notice'>You lock \the [src].</span>"
|
||||
src.locked = 1
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += redlight
|
||||
return
|
||||
else if ( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && locked &&!broken)
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += emag
|
||||
overlays += sparks
|
||||
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
|
||||
@@ -357,10 +357,10 @@
|
||||
if(!broken && !opened && prob(50/severity))
|
||||
if(!locked)
|
||||
src.locked = 1
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += redlight
|
||||
else
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += emag
|
||||
overlays += sparks
|
||||
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/obj/structure/stool/bed/chair/e_chair/rotate()
|
||||
..()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) //there's probably a better way of handling this, but eh. -Pete
|
||||
return
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
/obj/structure/dispenser/update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
switch(oxygentanks)
|
||||
if(1 to 3) overlays += "oxygen-[oxygentanks]"
|
||||
if(4 to INFINITY) overlays += "oxygen-4"
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
user.visible_message("<span class='notice'>[user] adjusts the shower with the [I].</span>", "<span class='notice'>You adjust the shower with the [I].</span>")
|
||||
|
||||
/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up
|
||||
overlays = null //once it's been on for a while, in addition to handling the water overlay.
|
||||
overlays.Cut() //once it's been on for a while, in addition to handling the water overlay.
|
||||
if(mymist)
|
||||
del(mymist)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user