From b6045a2bbe7f65a1b7598215b19b2eda152ac425 Mon Sep 17 00:00:00 2001 From: d3athrow Date: Sun, 29 Dec 2013 18:51:42 -0600 Subject: [PATCH] Fix move_inside verb exploit across the board Conflicts: code/game/machinery/Sleeper.dm --- code/game/dna/dna_modifier.dm | 2 ++ code/game/machinery/Sleeper.dm | 60 ++++++++++++++++------------------ code/game/machinery/cryo.dm | 2 ++ code/game/mecha/mecha.dm | 2 ++ 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index b90837af82c..aefc5d18e92 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -102,6 +102,8 @@ if (usr.stat != 0) return + if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other + return if (!ishuman(usr) && !ismonkey(usr)) //Make sure they're a mob that has dna usr << "\blue Try as you might, you can not climb up into the scanner." return diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 154bbd047d7..4d573e1eea2 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -381,40 +381,38 @@ add_fingerprint(usr) return - verb/move_inside() - set name = "Enter Sleeper" - set category = "Object" - set src in oview(1) +/obj/machinery/sleeper/verb/move_inside() + set name = "Enter Sleeper" + set category = "Object" + set src in oview(1) + if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr))) + return - if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr))) + if(src.occupant) + usr << "\blue The sleeper is already occupied!" + return + if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other + return + for(var/mob/living/carbon/slime/M in range(1,usr)) + if(M.Victim == usr) + usr << "You're too busy getting your life sucked out of you." return - + visible_message("[usr] starts climbing into the sleeper.", 3) + if(do_after(usr, 20)) if(src.occupant) usr << "\blue The sleeper is already occupied!" return + usr.stop_pulling() + usr.client.perspective = EYE_PERSPECTIVE + usr.client.eye = src + usr.loc = src + src.occupant = usr + src.icon_state = "sleeper_1" + if(orient == "RIGHT") + icon_state = "sleeper_1-r" - for(var/mob/living/carbon/slime/M in range(1,usr)) - if(M.Victim == usr) - usr << "You're too busy getting your life sucked out of you." - return - visible_message("[usr] starts climbing into the sleeper.", 3) - if(do_after(usr, 20)) - if(src.occupant) - usr << "\blue The sleeper is already occupied!" - return - usr.stop_pulling() - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src - usr.loc = src - src.occupant = usr - src.icon_state = "sleeper_1" - if(orient == "RIGHT") - icon_state = "sleeper_1-r" - - usr << "\blue You feel cool air surround you. You go numb as your senses turn inward." - - for(var/obj/O in src) - del(O) - src.add_fingerprint(usr) - return - return \ No newline at end of file + for(var/obj/O in src) + del(O) + src.add_fingerprint(usr) + return + return \ No newline at end of file diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index e2bc50608f8..2e03725c2b1 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -314,6 +314,8 @@ return if (usr.stat != 0 || stat & (NOPOWER|BROKEN)) return + if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other + return put_mob(usr) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 1b8bd82f0aa..9246e080fac 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -973,6 +973,8 @@ set name = "Enter Exosuit" set src in oview(1) + if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other + return if (usr.stat || !ishuman(usr)) return src.log_message("[usr] tries to move in.")