diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index 65d13292e2b..82f86db4a9f 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -314,6 +314,7 @@ playsound(chassis, 'sound/items/syringeproj.ogg', 50, 1) log_message("Launched [mechsyringe] from [src], targeting [target].") var/mob/originaloccupant = chassis.occupant + var/original_target_zone = originaloccupant.zone_selected spawn(0) src = null //if src is deleted, still process the syringe var/max_range = 6 @@ -330,7 +331,7 @@ if(M) var/R mechsyringe.visible_message(" [M] was hit by the syringe!") - if(M.can_inject(null, TRUE)) + if(M.can_inject(originaloccupant, TRUE, original_target_zone)) if(mechsyringe.reagents) for(var/datum/reagent/A in mechsyringe.reagents.reagent_list) R += A.id + " (" diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index c2f4914351c..39051b1cc0d 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -396,7 +396,10 @@ /datum/plant_gene/trait/stinging/on_throw_impact(obj/item/reagent_containers/food/snacks/grown/G, atom/target) if(isliving(target) && G.reagents && G.reagents.total_volume) var/mob/living/L = target - if(L.reagents && L.can_inject(null, FALSE)) + // It would be nice to inject the body part the original thrower aimed at, + // but we don't have this kind of information here. So pick something at random. + var/target_zone = pick("chest", "chest", "chest", "l_leg", "r_leg", "l_arm", "r_arm", "head") + if(L.reagents && L.can_inject(null, FALSE, target_zone)) var/injecting_amount = max(1, G.seed.potency*0.2) // Minimum of 1, max of 20 var/fraction = min(injecting_amount/G.reagents.total_volume, 1) G.reagents.reaction(L, REAGENT_INGEST, fraction) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 42e861ce45e..379a54970d5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1021,34 +1021,34 @@ return /mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, penetrate_thick = FALSE) - . = 1 + . = TRUE if(!target_zone) if(!user) - target_zone = pick("chest","chest","chest","left leg","right leg","left arm", "right arm", "head") + . = FALSE + CRASH("can_inject() called on a human mob with neither a user nor a targeting zone selected.") else target_zone = user.zone_selected - if(PIERCEIMMUNE in dna.species.species_traits) - . = 0 + . = FALSE var/obj/item/organ/external/affecting = get_organ(target_zone) var/fail_msg if(!affecting) - . = 0 + . = FALSE fail_msg = "[p_they(TRUE)] [p_are()] missing that limb." else if(affecting.is_robotic()) - . = 0 + . = FALSE fail_msg = "That limb is robotic." else switch(target_zone) if("head") if(head && head.flags & THICKMATERIAL && !penetrate_thick) - . = 0 + . = FALSE else if(wear_suit && wear_suit.flags & THICKMATERIAL && !penetrate_thick) - . = 0 + . = FALSE if(!. && error_msg && user) if(!fail_msg) fail_msg = "There is no exposed flesh or thin material [target_zone == "head" ? "on [p_their()] head" : "on [p_their()] body"] to inject into."