diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 5e33df7f56f..9439757282a 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -312,17 +312,7 @@ if(usr.stat || usr.restrained()) return - if(istype(usr,/mob/living/silicon)) - if(istype(usr,/mob/living/silicon/robot)) - var/mob/living/silicon/robot/R = usr - if(!(R.module && istype(R.module,/obj/item/weapon/robot_module/butler) )) - usr << "\red The vending machine refuses to interface with you, as you are not in its target demographic!" - return - else - usr << "\red The vending machine refuses to interface with you, as you are not in its target demographic!" - return - - if(href_list["remove_coin"]) + if(href_list["remove_coin"] && !istype(usr,/mob/living/silicon)) if(!coin) usr << "There is no coin in this machine." return @@ -338,6 +328,16 @@ usr.set_machine(src) if ((href_list["vend"]) && (src.vend_ready) && (!currently_vending)) + if(istype(usr,/mob/living/silicon)) + if(istype(usr,/mob/living/silicon/robot)) + var/mob/living/silicon/robot/R = usr + if(!(R.module && istype(R.module,/obj/item/weapon/robot_module/butler) )) + usr << "\red The vending machine refuses to interface with you, as you are not in its target demographic!" + return + else + usr << "\red The vending machine refuses to interface with you, as you are not in its target demographic!" + return + if ((!src.allowed(usr)) && (!src.emagged) && (src.wires & WIRE_SCANID)) //For SECURE VENDING MACHINES YEAH usr << "\red Access denied." //Unless emagged of course flick(src.icon_deny,src) diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 78ccd65c287..dd31d28ac76 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -189,18 +189,11 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 . = ..() vessel.remove_reagent("blood",amount) // Removes blood if human -//Transfers blood from container ot vessels, respecting blood types compatability. -/mob/living/carbon/human/proc/inject_blood(obj/item/weapon/reagent_containers/container, var/amount) - var/datum/reagent/blood/our = get_blood(vessel) +//Transfers blood from container ot vessels +/mob/living/carbon/proc/inject_blood(obj/item/weapon/reagent_containers/container, var/amount) var/datum/reagent/blood/injected = get_blood(container.reagents) if (!injected) return - if(blood_incompatible(injected.data["blood_type"],our.data["blood_type"]) ) - reagents.add_reagent("toxin",amount * 0.5) - reagents.update_total() - else - vessel.add_reagent("blood", amount, injected.data) - vessel.update_total() src.virus2 |= virus_copylist(injected.data["virus2"]) if (injected.data["antibodies"] && prob(5)) antibodies |= injected.data["antibodies"] @@ -208,11 +201,24 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 chems = params2list(injected.data["trace_chem"]) for(var/C in chems) src.reagents.add_reagent(C, (text2num(chems[C]) / 560) * amount)//adds trace chemicals to owner's blood - //world << "added [(text2num(chems[C])/560) * amount] = [text2num(chems[C])]/560*[amount] units of [C] to [src]" //DEBUG reagents.update_total() container.reagents.remove_reagent("blood", amount) +//Transfers blood from container ot vessels, respecting blood types compatability. +/mob/living/carbon/human/inject_blood(obj/item/weapon/reagent_containers/container, var/amount) + var/datum/reagent/blood/our = get_blood(vessel) + var/datum/reagent/blood/injected = get_blood(container.reagents) + if (!injected || !our) + return + if(blood_incompatible(injected.data["blood_type"],our.data["blood_type"]) ) + reagents.add_reagent("toxin",amount * 0.5) + reagents.update_total() + else + vessel.add_reagent("blood", amount, injected.data) + vessel.update_total() + ..() + //Gets human's own blood. /mob/living/carbon/proc/get_blood(datum/reagents/container) var/datum/reagent/blood/res = locate() in container.reagent_list //Grab some blood diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index d93ce042295..38e9c6f6882 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -154,9 +154,9 @@ B = d break var/trans - if(B && ishuman(target)) - var/mob/living/carbon/human/H = target - H.inject_blood(src,5) + if(B && istype(target,/mob/living/carbon)) + var/mob/living/carbon/C = target + C.inject_blood(src,5) else trans = src.reagents.trans_to(target, amount_per_transfer_from_this) user << "\blue You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units."