From a0847aa567efd62af43ca248f0e5e0d449f72fc3 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Tue, 4 Jun 2013 13:08:21 +0400 Subject: [PATCH 1/2] Fixes #2964 Now def_zone and tool are saved before sleep, to prevent changing them during it --- code/modules/surgery/surgery.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 62b9afb52c0..deae1e3382d 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -68,14 +68,16 @@ proc/do_surgery(mob/living/M, mob/living/user, obj/item/tool) return 0 if (user.a_intent == "harm") //check for Hippocratic Oath return 0 + var/obj/item/T = tool + var/def_zone = user.zone_sel.selecting for(var/datum/surgery_step/S in surgery_steps) - if( (S.isright(tool) || S.isacceptable(tool)) && \ - S.can_use(user, M, user.zone_sel.selecting, tool)) //check if tool is right or close enough and if this step is possible - S.begin_step(user, M, user.zone_sel.selecting, tool) //start on it + if( (S.isright(T) || S.isacceptable(T)) && \ + S.can_use(user, M, def_zone, T)) //check if tool is right or close enough and if this step is possible + S.begin_step(user, M, def_zone, T) //start on it if(do_mob(user, M, rand(S.min_duration, S.max_duration))) //if user did nto move or changed hands - S.end_step(user, M, user.zone_sel.selecting, tool) //finish successfully + S.end_step(user, M, def_zone, T) //finish successfully else //or - S.fail_step(user, M, user.zone_sel.selecting, tool) //malpractice~ + S.fail_step(user, M, def_zone, T) //malpractice~ return 1 //don't want to do weapony things after surgery return 0 From 0ad08b13cc47018f351946ab5a18fc5017a93c08 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Tue, 4 Jun 2013 13:14:51 +0400 Subject: [PATCH 2/2] Fixes #2954 Winners do no use Space Drugs to escape from cuffs. --- code/modules/reagents/Chemistry-Reagents.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index cd49cfde524..55c255d42dd 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -512,7 +512,7 @@ datum if(!M) M = holder.my_atom M.druggy = max(M.druggy, 15) if(isturf(M.loc) && !istype(M.loc, /turf/space)) - if(M.canmove) + if(M.canmove && !M.restrained()) if(prob(10)) step(M, pick(cardinal)) if(prob(7)) M.emote(pick("twitch","drool","moan","giggle")) holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM) @@ -642,7 +642,7 @@ datum on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom - if(M.canmove && istype(M.loc, /turf/space)) + if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) step(M, pick(cardinal)) if(prob(5)) M.emote(pick("twitch","drool","moan")) ..() @@ -728,7 +728,7 @@ datum on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom - if(M.canmove && istype(M.loc, /turf/space)) + if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) step(M, pick(cardinal)) if(prob(5)) M.emote(pick("twitch","drool","moan")) ..()