Clean up window coloring code a bit. Also makes windowspawners only create

windows where needed, not everywhere then deleting the ones it doesn't
want.
This commit is contained in:
Tigercat2000
2015-06-18 19:58:08 -07:00
parent 654cb37e9a
commit d7e9c36474
3 changed files with 31 additions and 46 deletions
@@ -7,26 +7,28 @@
var/windowtospawn = /obj/structure/window/basic
/obj/effect/spawner/window/New()
for(var/obj/structure/grille/G in get_turf(src)) qdel(G) //just in case mappers don't know what they are doing
spawn(0)
for(var/obj/structure/grille/G in get_turf(src)) qdel(G) //just in case mappers don't know what they are doing
if(!useFull)
for(var/cdir in cardinal)
var/obj/structure/window/WI = new windowtospawn(get_turf(src))
WI.dir = cdir
for(var/obj/effect/spawner/window/WS in get_step(src,cdir))
qdel(WI)
break
else
var/obj/structure/window/W = new windowtospawn(get_turf(src))
W.dir = SOUTHWEST
if(!useFull)
for(var/cdir in cardinal)
for(var/obj/effect/spawner/window/WS in get_step(src,cdir))
cdir = null
break
if(!cdir) continue
var/obj/structure/window/WI = new windowtospawn(get_turf(src))
WI.dir = cdir
else
var/obj/structure/window/W = new windowtospawn(get_turf(src))
W.dir = SOUTHWEST
if(useGrille)
new /obj/structure/grille(get_turf(src))
if(useGrille)
new /obj/structure/grille(get_turf(src))
src.air_update_turf(1) //atmos can pass otherwise
src.air_update_turf(1) //atmos can pass otherwise
spawn(10)
qdel(src)
spawn(10)
qdel(src)
/obj/effect/spawner/window/reinforced
name = "reinforced window spawner"