diff --git a/code/datums/browser.dm b/code/datums/browser.dm index f456250b204..a19c5bafe52 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -101,14 +101,16 @@ [get_footer()] "} -/datum/browser/proc/open(var/use_onclose = 1, var/no_focus = 0) +/datum/browser/proc/open(use_onclose = TRUE, no_focus = FALSE) set waitfor = FALSE var/window_size = "" if(width && height) window_size = "size=[width]x[height];" user << browse(get_content(), "window=[window_id];[window_size][window_options]") for(var/i in 1 to 1000) - if(winexists(user,window_id)) + if(!user || !user.client) + return + if(winexists(user, window_id)) break sleep(1) if(no_focus) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 9af176e3f31..3485021184f 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -151,7 +151,7 @@ var/ue_to_compare = (old_ue) ? old_ue : dna.unique_enzymes var/list/all_bits = internal_organs|bodyparts for(var/obj/item/organ/organ as anything in all_bits) - if(assimilate || organ.dna.unique_enzymes == ue_to_compare) + if(assimilate || organ.dna?.unique_enzymes == ue_to_compare) organ.update_DNA(dna) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index ac0ddef78c2..5d939a2f0cb 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -243,21 +243,20 @@ user.visible_message("[user] notices that no dead organs in [target]'s [affected.name].", \ "You notice that no dead organs in [target]'s [affected.name].") return FALSE - else if(C.reagents.has_reagent("mitocholide")) + if(C.reagents.has_reagent("mitocholide")) user.visible_message("[user] notices there is not enough mitocholide in [tool].", \ "You notice there is not enough mitocholide in [tool].") return FALSE + if(C.reagents.total_volume <= 0) //end_step handles if there is not enough reagent + user.visible_message("[user] notices [tool] is empty.", "You notice [tool] is empty.") + return FALSE for(var/obj/item/organ/internal/organ as anything in affected.internal_organs) - if(C.reagents.total_volume <= 0) //end_step handles if there is not enough reagent - user.visible_message("[user] notices [tool] is empty.", "You notice [tool] is empty.") - return FALSE - - var/msg = "[user] starts pouring some of [tool] over [target]'s [I.name]." - var/self_msg = "You start pouring some of [tool] over [target]'s [I.name]." + var/msg = "[user] starts pouring some of [tool] over [target]'s [organ.name]." + var/self_msg = "You start pouring some of [tool] over [target]'s [organ.name]." if(istype(C,/obj/item/reagent_containers/syringe)) - msg = "[user] begins injecting [tool] into [target]'s [I.name]." - self_msg = "You begin injecting [tool] into [target]'s [I.name]." + msg = "[user] begins injecting [tool] into [target]'s [organ.name]." + self_msg = "You begin injecting [tool] into [target]'s [organ.name]." user.visible_message(msg, self_msg) if(H && affected) H.custom_pain("Something burns horribly in your [affected.name]!")