From 3472469e8112d152a20466e3f3f87e5019c8fa22 Mon Sep 17 00:00:00 2001 From: py01 Date: Tue, 10 Sep 2019 20:30:05 -0700 Subject: [PATCH] surgeries automatically retry if fumbled --- code/modules/surgery/surgery_step.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index 973f1396ec5..7ea010b4ca2 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -76,13 +76,16 @@ prob_chance = implements[implement_type] prob_chance *= surgery.get_propability_multiplier() - if((prob(prob_chance) || (iscyborg(user) && !silicons_obey_prob)) && chem_check(target) && !try_to_fail) + var/chem_check_result = chem_check(target) + if((prob(prob_chance) || (iscyborg(user) && !silicons_obey_prob)) && chem_check_result && !try_to_fail) if(success(user, target, target_zone, tool, surgery)) advance = TRUE else if(failure(user, target, target_zone, tool, surgery)) advance = TRUE - + if(chem_check_result) + if(.(user, target, target_zone, tool, surgery, try_to_fail)) //automatically re-attempt if failed for reason other than lack of required chemical + advance = TRUE if(advance && !repeatable) surgery.status++ if(surgery.status > surgery.steps.len)