Overlays not being removed?
|
|
Code:
obj/points icon = 'lp_display.dmi'
bg layer = FLOAT_LAYER-4
ring layer = FLOAT_LAYER-3 numbers layer = FLOAT_LAYER-2 symbol layer = FLOAT_LAYER-2
mob/proc/LPRefresh(lptype) if(!src) return
overlays -= typesof(/obj/points)
var slot1 slot2 slot3 slot4 slot5 U = 0 X = 0 Y = 0 lptext = num2text(round(LP))
switch(dir) if(NORTH) X = -32 if(SOUTH) X = 32 if(EAST) X = -16 Y = -16 if(WEST) X = 16 Y = -16
if(LP>99999) slot1 = "9" slot2 = "9" slot3 = "9" slot4 = "9" slot5 = "9"
else if(LP<9999) U =- 2 if(length(lptext)<5) var/max=5-length(lptext) for(var/i=0,i<max,i++) lptext="*[lptext]" slot1 = copytext(lptext,1,2) slot2 = copytext(lptext,2,3) slot3 = copytext(lptext,3,4) slot4 = copytext(lptext,4,5) slot5 = copytext(lptext,5,6) var/obj/points/symbol/nLP = new/obj/points/symbol nLP.icon_state = "lp" nLP.pixel_x = X nLP.pixel_y = Y overlays += nLP
var/obj/points/bg/BG = new/obj/points/bg BG.icon_state = "lp_bg[rand(1,3)]" BG.pixel_x = X BG.pixel_y = Y overlays += BG var/obj/points/ring/RN = new/obj/points/ring RN.icon_state = "lp_[lptype]" RN.pixel_x = X RN.pixel_y = Y overlays += RN
var/obj/points/numbers/N1 = new/obj/points/numbers N1.icon_state = "[slot1]" N1.pixel_x = X+6+U N1.pixel_y = Y-13 overlays += N1
var/obj/points/numbers/N2 = new/obj/points/numbers N2.icon_state = "[slot2]" N2.pixel_x = X+10+U N2.pixel_y = Y-13 overlays += N2
var/obj/points/numbers/N3 = new/obj/points/numbers N3.icon_state = "[slot3]" N3.pixel_x = X+14+U N3.pixel_y = Y-13 overlays += N3
var/obj/points/numbers/N4 = new/obj/points/numbers N4.icon_state = "[slot4]" N4.pixel_x = X+18+U N4.pixel_y = Y-13 overlays += N4
var/obj/points/numbers/N5 = new/obj/points/numbers N5.icon_state = "[slot5]" N5.pixel_x = X+22+U N5.pixel_y = Y-13 overlays += N5
spawn(20) if(src) overlays -= typesof(/obj/points)
return
|
Problem description:
The overlays are not being removed.
I have tried doing "overlays -=" of the one of the objects instead (nLP / BG / N1 etc) and that worked... yet for some reason the typesof() fails.
I'm told you cant do typesof() with overlays, but ive done this in another proc and it worked fine. The only difference was that i was making the overlay directly (+= /obj/type/something/thing) then removing all of that type later in another proc (-= typesof(obj/type/something)).
Anyone know why this is happening? :/
|