From e3e65a523712166027e788fb61c84b4c8fc3f4da Mon Sep 17 00:00:00 2001 From: YPO <30683121+YPOQ@users.noreply.github.com> Date: Sun, 11 Feb 2018 19:29:43 -0700 Subject: [PATCH 1/2] Fixes blood contracts being unusable if the popup is cancelled --- .../mining/lavaland/necropolis_chests.dm | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 2ef83c54b7..442a2aa2dc 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -910,19 +910,19 @@ if(used) return used = TRUE - + var/list/da_list = list() for(var/I in GLOB.alive_mob_list & GLOB.player_list) var/mob/living/L = I da_list[L.real_name] = L - - var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in da_list - - choice = da_list[choice] - - if(!choice) - return + var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in da_list + + choice = da_list[choice] + + if(!choice) + used = FALSE + return if(!(isliving(choice))) to_chat(user, "[choice] is already dead!") used = FALSE @@ -931,26 +931,25 @@ to_chat(user, "You feel like writing your own name into a cursed death warrant would be unwise.") used = FALSE return - else - var/mob/living/L = choice + var/mob/living/L = choice - message_admins("[L] has been marked for death!") + message_admins("[L] has been marked for death!") - var/datum/objective/survive/survive = new - survive.owner = L.mind - L.mind.objectives += survive - add_logs(user, L, "took out a blood contract on", src) - to_chat(L, "You've been marked for death! Don't let the demons get you!") - L.add_atom_colour("#FF0000", ADMIN_COLOUR_PRIORITY) - var/obj/effect/mine/pickup/bloodbath/B = new(L) - INVOKE_ASYNC(B, /obj/effect/mine/pickup/bloodbath/.proc/mineEffect, L) + var/datum/objective/survive/survive = new + survive.owner = L.mind + L.mind.objectives += survive + add_logs(user, L, "took out a blood contract on", src) + to_chat(L, "You've been marked for death! Don't let the demons get you!") + L.add_atom_colour("#FF0000", ADMIN_COLOUR_PRIORITY) + var/obj/effect/mine/pickup/bloodbath/B = new(L) + INVOKE_ASYNC(B, /obj/effect/mine/pickup/bloodbath/.proc/mineEffect, L) - for(var/mob/living/carbon/human/H in GLOB.player_list) - if(H == L) - continue - to_chat(H, "You have an overwhelming desire to kill [L]. [L.p_they(TRUE)] [L.p_have()] been marked red! Go kill [L.p_them()]!") - H.put_in_hands(new /obj/item/kitchen/knife/butcher(H), TRUE) + for(var/mob/living/carbon/human/H in GLOB.player_list) + if(H == L) + continue + to_chat(H, "You have an overwhelming desire to kill [L]. [L.p_they(TRUE)] [L.p_have()] been marked red! Go kill [L.p_them()]!") + H.put_in_hands(new /obj/item/kitchen/knife/butcher(H), TRUE) qdel(src)