From b76595d03e59803cf0cce5dc0678bfac71fc0721 Mon Sep 17 00:00:00 2001 From: Lo6a4evskiy Date: Thu, 14 Aug 2014 13:33:10 +0400 Subject: [PATCH 1/4] Broken grilles won't summon new rods when hit --- code/game/objects/structures/grille.dm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index a526f7ec191..529758e2fb2 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -178,19 +178,18 @@ if("brute") health -= W.force * 0.1 healthcheck() - ..() +// ..() return /obj/structure/grille/proc/healthcheck() if(health <= 0) - var/obj/item/stack/rods/newrods = new(loc) - transfer_fingerprints_to(newrods) - if(!destroyed) icon_state = "brokengrille" density = 0 destroyed = 1 + var/obj/item/stack/rods/newrods = new(loc) + transfer_fingerprints_to(newrods) else if(health <= -6) From 6b628667edcb0f5a07a24f90cab3bfbfe6773282 Mon Sep 17 00:00:00 2001 From: Lo6a4evskiy Date: Thu, 14 Aug 2014 13:36:00 +0400 Subject: [PATCH 2/4] Accidentally left unnecessary comment --- code/game/objects/structures/grille.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 529758e2fb2..59da7493032 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -178,7 +178,7 @@ if("brute") health -= W.force * 0.1 healthcheck() -// ..() + ..() return From 04ce0616e7b807e94572be9e54f26ef9c7b5be67 Mon Sep 17 00:00:00 2001 From: Lo6a4evskiy Date: Thu, 14 Aug 2014 13:50:41 +0400 Subject: [PATCH 3/4] Cannot place one-way glass by clicking on destroyed grille --- code/game/objects/structures/grille.dm | 81 +++++++++++++------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 59da7493032..2166cb17115 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -120,50 +120,51 @@ //window placing begin else if(istype(W, /obj/item/stack/sheet/rglass) || istype(W, /obj/item/stack/sheet/glass)) - var/obj/item/stack/ST = W - if (ST.get_amount() < 1) - user << "You need at least one sheet of glass for that." - return - var/dir_to_set = 1 - if(loc == user.loc) - dir_to_set = user.dir - else - if( ( x == user.x ) || (y == user.y) ) //Only supposed to work for cardinal directions. - if( x == user.x ) - if( y > user.y ) - dir_to_set = 2 - else - dir_to_set = 1 - else if( y == user.y ) - if( x > user.x ) - dir_to_set = 8 - else - dir_to_set = 4 - else - user << "You can't reach." - return //Only works for cardinal direcitons, diagonals aren't supposed to work like this. - for(var/obj/structure/window/WINDOW in loc) - if(WINDOW.dir == dir_to_set) - user << "There is already a window facing this way there." + if(!destroyed) + var/obj/item/stack/ST = W + if (ST.get_amount() < 1) + user << "You need at least one sheet of glass for that." return - user << "You start placing the window." - if(do_after(user,20)) - if(!src) return //Grille destroyed while waiting + var/dir_to_set = 1 + if(loc == user.loc) + dir_to_set = user.dir + else + if( ( x == user.x ) || (y == user.y) ) //Only supposed to work for cardinal directions. + if( x == user.x ) + if( y > user.y ) + dir_to_set = 2 + else + dir_to_set = 1 + else if( y == user.y ) + if( x > user.x ) + dir_to_set = 8 + else + dir_to_set = 4 + else + user << "You can't reach." + return //Only works for cardinal direcitons, diagonals aren't supposed to work like this. for(var/obj/structure/window/WINDOW in loc) - if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting. + if(WINDOW.dir == dir_to_set) user << "There is already a window facing this way there." return - var/obj/structure/window/WD - if(istype(W, /obj/item/stack/sheet/rglass)) - WD = new/obj/structure/window(loc,1) //reinforced window - else - WD = new/obj/structure/window(loc,0) //normal window - WD.dir = dir_to_set - WD.ini_dir = dir_to_set - WD.anchored = 0 - WD.state = 0 - ST.use(1) - user << "You place the [WD] on [src]." + user << "You start placing the window." + if(do_after(user,20)) + if(!src) return //Grille destroyed while waiting + for(var/obj/structure/window/WINDOW in loc) + if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting. + user << "There is already a window facing this way there." + return + var/obj/structure/window/WD + if(istype(W, /obj/item/stack/sheet/rglass)) + WD = new/obj/structure/window(loc,1) //reinforced window + else + WD = new/obj/structure/window(loc,0) //normal window + WD.dir = dir_to_set + WD.ini_dir = dir_to_set + WD.anchored = 0 + WD.state = 0 + ST.use(1) + user << "You place the [WD] on [src]." return //window placing end From 54c8cc0f668b2b5cf0f5847e768ef33f559f97f3 Mon Sep 17 00:00:00 2001 From: Lo6a4evskiy Date: Thu, 14 Aug 2014 13:56:19 +0400 Subject: [PATCH 4/4] Some cleanup --- code/game/objects/structures/grille.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 2166cb17115..df18f1b114e 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -120,7 +120,7 @@ //window placing begin else if(istype(W, /obj/item/stack/sheet/rglass) || istype(W, /obj/item/stack/sheet/glass)) - if(!destroyed) + if (!destroyed) var/obj/item/stack/ST = W if (ST.get_amount() < 1) user << "You need at least one sheet of glass for that." @@ -165,7 +165,7 @@ WD.state = 0 ST.use(1) user << "You place the [WD] on [src]." - return + return //window placing end else if(istype(W, /obj/item/weapon/shard))