From 86190c0edb65e628b3b1a30a5a981381c05b1d6f Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Wed, 14 May 2014 21:54:49 +1200 Subject: [PATCH 1/3] Fix resisting out of closets - Removed do_after proc since it was hanging somewhere --- code/modules/mob/living/living.dm | 77 +++++++++++++++---------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 4998c4cbc8..ec67f4912c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -565,47 +565,46 @@ O.show_message("\red The [L.loc] begins to shake violently!", 1) - spawn(0) - if(do_after(usr,(breakout_time*60*10))) //minutes * 60seconds * 10deciseconds - if(!C || !L || L.stat != CONSCIOUS || L.loc != C || C.opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened + spawn(breakout_time*60*10) //minutes * 60seconds * 10deciseconds + if(!C || !L || L.stat != CONSCIOUS || L.loc != C || C.opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened + return + + //Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'... + if(istype(L.loc, /obj/structure/closet/secure_closet)) + var/obj/structure/closet/secure_closet/SC = L.loc + if(!SC.locked && !SC.welded) + return + else + if(!C.welded) return - //Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'... - if(istype(L.loc, /obj/structure/closet/secure_closet)) - var/obj/structure/closet/secure_closet/SC = L.loc - if(!SC.locked && !SC.welded) - return - else - if(!C.welded) - return - - //Well then break it! - if(istype(usr.loc, /obj/structure/closet/secure_closet)) - var/obj/structure/closet/secure_closet/SC = L.loc - SC.desc = "It appears to be broken." - SC.icon_state = SC.icon_off - flick(SC.icon_broken, SC) - sleep(10) - flick(SC.icon_broken, SC) - sleep(10) - SC.broken = 1 - SC.locked = 0 - usr << "\red You successfully break out!" - for(var/mob/O in viewers(L.loc)) - O.show_message("\red \the [usr] successfully broke out of \the [SC]!", 1) - if(istype(SC.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace) - var/obj/structure/bigDelivery/BD = SC.loc - BD.attack_hand(usr) - SC.open() - else - C.welded = 0 - usr << "\red You successfully break out!" - for(var/mob/O in viewers(L.loc)) - O.show_message("\red \the [usr] successfully broke out of \the [C]!", 1) - if(istype(C.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above - var/obj/structure/bigDelivery/BD = C.loc - BD.attack_hand(usr) - C.open() + //Well then break it! + if(istype(usr.loc, /obj/structure/closet/secure_closet)) + var/obj/structure/closet/secure_closet/SC = L.loc + SC.desc = "It appears to be broken." + SC.icon_state = SC.icon_off + flick(SC.icon_broken, SC) + sleep(10) + flick(SC.icon_broken, SC) + sleep(10) + SC.broken = 1 + SC.locked = 0 + usr << "\red You successfully break out!" + for(var/mob/O in viewers(L.loc)) + O.show_message("\red \the [usr] successfully broke out of \the [SC]!", 1) + if(istype(SC.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace) + var/obj/structure/bigDelivery/BD = SC.loc + BD.attack_hand(usr) + SC.open() + else + C.welded = 0 + usr << "\red You successfully break out!" + for(var/mob/O in viewers(L.loc)) + O.show_message("\red \the [usr] successfully broke out of \the [C]!", 1) + if(istype(C.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above + var/obj/structure/bigDelivery/BD = C.loc + BD.attack_hand(usr) + C.open() //breaking out of handcuffs else if(iscarbon(L)) From 03a01fc80561ec13b5dd05e9fa766b96a72acbfc Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Wed, 14 May 2014 21:55:51 +1200 Subject: [PATCH 2/3] Closet wrapping fix - Removed ability to wrap closets if you are inside them --- code/modules/recycling/sortingmachinery.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index eecba616fb..a5eb401019 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -99,6 +99,8 @@ return if(target in user) return + if(user in target) //no wrapping closets that you are inside - it's not physically possible + return user.attack_log += text("\[[time_stamp()]\] Has used [src.name] on \ref[target]") From 78e022464999be9eee36782e4306c7cf1046a2f5 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Thu, 15 May 2014 23:03:21 +1200 Subject: [PATCH 3/3] Fixed resisting out of lockers --- code/__HELPERS/unsorted.dm | 4 +- code/modules/mob/living/living.dm | 79 ++++++++++++++++--------------- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index dd2a2b9dcc..ba60be32d7 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -727,14 +727,14 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl return 0 var/delayfraction = round(delay/numticks) - var/turf/T = get_turf(user) + var/original_loc = user.loc var/holding = user.get_active_hand() for(var/i = 0, iThe [L.loc] begins to shake violently!", 1) - spawn(breakout_time*60*10) //minutes * 60seconds * 10deciseconds - if(!C || !L || L.stat != CONSCIOUS || L.loc != C || C.opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened - return - - //Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'... - if(istype(L.loc, /obj/structure/closet/secure_closet)) - var/obj/structure/closet/secure_closet/SC = L.loc - if(!SC.locked && !SC.welded) - return - else - if(!C.welded) + spawn(0) + if(do_after(usr,(breakout_time*60*10))) //minutes * 60seconds * 10deciseconds + if(!C || !L || L.stat != CONSCIOUS || L.loc != C || C.opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened return - //Well then break it! - if(istype(usr.loc, /obj/structure/closet/secure_closet)) - var/obj/structure/closet/secure_closet/SC = L.loc - SC.desc = "It appears to be broken." - SC.icon_state = SC.icon_off - flick(SC.icon_broken, SC) - sleep(10) - flick(SC.icon_broken, SC) - sleep(10) - SC.broken = 1 - SC.locked = 0 - usr << "\red You successfully break out!" - for(var/mob/O in viewers(L.loc)) - O.show_message("\red \the [usr] successfully broke out of \the [SC]!", 1) - if(istype(SC.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace) - var/obj/structure/bigDelivery/BD = SC.loc - BD.attack_hand(usr) - SC.open() - else - C.welded = 0 - usr << "\red You successfully break out!" - for(var/mob/O in viewers(L.loc)) - O.show_message("\red \the [usr] successfully broke out of \the [C]!", 1) - if(istype(C.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above - var/obj/structure/bigDelivery/BD = C.loc - BD.attack_hand(usr) - C.open() + //Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'... + if(istype(L.loc, /obj/structure/closet/secure_closet)) + var/obj/structure/closet/secure_closet/SC = L.loc + if(!SC.locked && !SC.welded) + return + else + if(!C.welded) + return + + //Well then break it! + if(istype(usr.loc, /obj/structure/closet/secure_closet)) + var/obj/structure/closet/secure_closet/SC = L.loc + SC.desc = "It appears to be broken." + SC.icon_state = SC.icon_off + flick(SC.icon_broken, SC) + sleep(10) + flick(SC.icon_broken, SC) + sleep(10) + SC.broken = 1 + SC.locked = 0 + SC.update_icon() + usr << "\red You successfully break out!" + for(var/mob/O in viewers(L.loc)) + O.show_message("\red \the [usr] successfully broke out of \the [SC]!", 1) + if(istype(SC.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace) + var/obj/structure/bigDelivery/BD = SC.loc + BD.attack_hand(usr) + SC.open() + else + C.welded = 0 + C.update_icon() + usr << "\red You successfully break out!" + for(var/mob/O in viewers(L.loc)) + O.show_message("\red \the [usr] successfully broke out of \the [C]!", 1) + if(istype(C.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above + var/obj/structure/bigDelivery/BD = C.loc + BD.attack_hand(usr) + C.open() //breaking out of handcuffs else if(iscarbon(L))