mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +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:
@@ -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*
|
||||
|
||||
Reference in New Issue
Block a user