Medibots will no longer inject people in lockers/sleepers/etc (#31648)

This commit is contained in:
MoreRobustThanYou
2017-10-13 17:25:54 -04:00
committed by CitadelStationBot
parent b9c07e7f66
commit 282bc3e5f1
@@ -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