From 282bc3e5f1e1a8dd9228460b015b68baa6303e54 Mon Sep 17 00:00:00 2001 From: MoreRobustThanYou Date: Fri, 13 Oct 2017 17:25:54 -0400 Subject: [PATCH] Medibots will no longer inject people in lockers/sleepers/etc (#31648) --- .../mob/living/simple_animal/bot/medbot.dm | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 8f8e574de5..7e9ef07a94 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -341,13 +341,16 @@ /mob/living/simple_animal/bot/medbot/proc/assess_patient(mob/living/carbon/C) //Time to see if they need medical help! if(C.stat == DEAD || (C.status_flags & FAKEDEATH)) - return 0 //welp too late for them! + return FALSE //welp too late for them! + + if(!(loc == C.loc) || !(isturf(C.loc) && isturf(loc))) + return FALSE if(C.suiciding) - return 0 //Kevorkian school of robotic medical assistants. + return FALSE //Kevorkian school of robotic medical assistants. if(emagged == 2) //Everyone needs our medicine. (Our medicine is toxins) - return 1 + return TRUE if(declare_crit && C.health <= 0) //Critical condition! Call for help! declare(C) @@ -356,20 +359,20 @@ if((reagent_glass) && (use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15)))) for(var/datum/reagent/R in reagent_glass.reagents.reagent_list) if(!C.reagents.has_reagent(R.id)) - return 1 + return TRUE //They're injured enough for it! if((!C.reagents.has_reagent(treatment_brute_avoid)) && (C.getBruteLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_brute))) - return 1 //If they're already medicated don't bother! + return TRUE //If they're already medicated don't bother! if((!C.reagents.has_reagent(treatment_oxy_avoid)) && (C.getOxyLoss() >= (15 + heal_threshold)) && (!C.reagents.has_reagent(treatment_oxy))) - return 1 + return TRUE if((!C.reagents.has_reagent(treatment_fire_avoid)) && (C.getFireLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_fire))) - return 1 + return TRUE if((!C.reagents.has_reagent(treatment_tox_avoid)) && (C.getToxLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_tox))) - return 1 + return TRUE if(treat_virus && !C.reagents.has_reagent(treatment_virus_avoid) && !C.reagents.has_reagent(treatment_virus)) for(var/thing in C.viruses) @@ -378,9 +381,9 @@ if(!(D.visibility_flags & HIDDEN_SCANNER || D.visibility_flags & HIDDEN_PANDEMIC) \ && D.severity != VIRUS_SEVERITY_POSITIVE \ && (D.stage > 1 || (D.spread_flags & VIRUS_SPREAD_AIRBORNE))) // medibot can't detect a virus in its initial stage unless it spreads airborne. - return 1 //STOP DISEASE FOREVER + return TRUE //STOP DISEASE FOREVER - return 0 + return FALSE /mob/living/simple_animal/bot/medbot/UnarmedAttack(atom/A) if(iscarbon(A)) @@ -504,11 +507,11 @@ /mob/living/simple_animal/bot/medbot/proc/check_overdose(mob/living/carbon/patient,reagent_id,injection_amount) var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] if(!R.overdose_threshold) //Some chems do not have an OD threshold - return 0 + return FALSE var/current_volume = patient.reagents.get_reagent_amount(reagent_id) if(current_volume + injection_amount > R.overdose_threshold) - return 1 - return 0 + return TRUE + return FALSE /mob/living/simple_animal/bot/medbot/explode() on = FALSE