From 839a80ef922e7ea507d3c9db32f0dfd68626e815 Mon Sep 17 00:00:00 2001 From: "johnsonmt88@gmail.com" Date: Wed, 4 Apr 2012 02:31:35 +0000 Subject: [PATCH] Disposal and welding helmet exploit fixes: - You can no longer toggle the welding helmet when stunned or restrained. - You can no longer give yourself all-access via-disposals. Living mobs and living mobs inside of a container cancel their holder's destination. This still allows people wrapped in lockers to be sent to their proper destination, however it would require someone on the other end to open it. So it's their fault for not dragging it out before opening it. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3400 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/items/clothing.dm | 29 +++++++++++++++-------------- code/modules/recycling/disposal.dm | 19 +++++++++++++++++-- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/code/game/objects/items/clothing.dm b/code/game/objects/items/clothing.dm index f3a669b34a5..d3b53827528 100644 --- a/code/game/objects/items/clothing.dm +++ b/code/game/objects/items/clothing.dm @@ -251,20 +251,21 @@ THERMAL GLASSES /obj/item/clothing/head/helmet/welding/verb/toggle() set category = "Object" set name = "Adjust welding mask" - if(src.up) - src.up = !src.up - src.see_face = !src.see_face - src.flags |= HEADCOVERSEYES - flags_inv |= HIDEMASK|HIDEEARS|HIDEEYES - icon_state = "welding" - usr << "You flip the mask down to protect your eyes." - else - src.up = !src.up - src.see_face = !src.see_face - src.flags &= ~HEADCOVERSEYES - flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES) - icon_state = "weldingup" - usr << "You push the mask up out of your face." + if(usr.canmove && usr.stat != 2 && !usr.restrained()) + if(src.up) + src.up = !src.up + src.see_face = !src.see_face + src.flags |= HEADCOVERSEYES + flags_inv |= HIDEMASK|HIDEEARS|HIDEEYES + icon_state = "welding" + usr << "You flip the mask down to protect your eyes." + else + src.up = !src.up + src.see_face = !src.see_face + src.flags &= ~HEADCOVERSEYES + flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES) + icon_state = "weldingup" + usr << "You push the mask up out of your face." /obj/item/clothing/head/cargosoft/dropped() src.icon_state = "cargosoft" diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index c26e076d377..84df8d593f0 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -507,6 +507,7 @@ var/has_fat_guy = 0 // true if contains a fat person var/destinationTag = 0 // changes if contains a delivery container var/tomail = 0 //changes if contains wrapped package + var/hasmob = 0 //If it contains a mob // initialize a holder from the contents of a disposal unit @@ -514,6 +515,20 @@ if(!istype(D, /obj/machinery/disposal/toilet))//So it does not drain gas from a toilet which does not function on it. gas = D.air_contents// transfer gas resv. into holder object + //Check for any living mobs trigger hasmob. + //hasmob effects whether the package goes to cargo or its tagged destination. + for(var/mob/living/M in D) + if(M && M.stat != 2) + hasmob = 1 + + //Checks 1 contents level deep. This means that players can be sent through disposals... + //...but it should require a second person to open the package. (i.e. person inside a wrapped locker) + for(var/obj/O in D) + if(O.contents) + for(var/mob/living/M in O.contents) + if(M && M.stat != 2) + hasmob = 1 + // now everything inside the disposal gets put into the holder // note AM since can contain mobs or objs for(var/atom/movable/AM in D) @@ -522,10 +537,10 @@ var/mob/living/carbon/human/H = AM if(H.mutations & FAT) // is a human and fat? has_fat_guy = 1 // set flag on holder - if(istype(AM, /obj/effect/bigDelivery)) + if(istype(AM, /obj/effect/bigDelivery) && !hasmob) var/obj/effect/bigDelivery/T = AM src.destinationTag = T.sortTag - if(istype(AM, /obj/item/smallDelivery)) + if(istype(AM, /obj/item/smallDelivery) && !hasmob) var/obj/item/smallDelivery/T = AM src.destinationTag = T.sortTag