From d8b5afeca75530a399717aa82d470c17756eb485 Mon Sep 17 00:00:00 2001 From: Markolie Date: Mon, 17 Aug 2015 19:24:21 +0200 Subject: [PATCH 1/4] Cult loyalty implant fix --- code/datums/mind.dm | 8 ++++---- code/game/gamemodes/cult/cult.dm | 2 ++ code/game/gamemodes/cult/runes.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 8 +++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 81cdb93fd9a..8f74d67cc62 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -142,7 +142,7 @@ datum/mind var/mob/living/carbon/human/H = current if (istype(current, /mob/living/carbon/human)) /** Impanted**/ - if(H.is_loyalty_implanted(H)) + if(H.is_loyalty_implanted()) text = "Loyalty Implant:Remove|Implanted
" else text = "Loyalty Implant:No Implant|Implant him!
" @@ -152,7 +152,7 @@ datum/mind if (ticker.mode.config_tag=="revolution") text += uppertext(text) text = "[text]: " - if (H.is_loyalty_implanted(H)) + if (H.is_loyalty_implanted()) text += "LOYAL EMPLOYEE|headrev|rev" else if (src in ticker.mode.head_revolutionaries) text = "employee|HEADREV|rev" @@ -188,7 +188,7 @@ datum/mind if (ticker.mode.config_tag=="cult") text = uppertext(text) text = "[text]: " - if (H.is_loyalty_implanted(H)) + if (H.is_loyalty_implanted()) text += "LOYAL EMPLOYEE|cultist" else if (src in ticker.mode.cult) text += "employee|CULTIST" @@ -302,7 +302,7 @@ datum/mind if (ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan") text = uppertext(text) text = "[text]: " - if (H.is_loyalty_implanted(H)) + if (H.is_loyalty_implanted()) text +="traitor|LOYAL EMPLOYEE" else if (src in ticker.mode.traitors) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 93f2c468aa6..50819be8c1d 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -16,6 +16,8 @@ return 0 if(iscultist(mind.current)) return 1 //If they're already in the cult, assume they are convertable + if(jobban_isbanned(mind.current, "cultist") || jobban_isbanned(mind.current, "Syndicate")) + return 0 if(ishuman(mind.current) && (mind.assigned_role in list("Captain", "Chaplain"))) return 0 if(ishuman(mind.current)) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index d6343e88142..c42c9cec293 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -111,7 +111,7 @@ var/list/sacrificed = list() "\red AAAAAAHHHH!.", \ "\red You hear an anguished scream.") cult_log("[key_name_admin(usr)] tried to convert [key_name_admin(M)]") - if(is_convertable_to_cult(M.mind) && !jobban_isbanned(M, "cultist") && !jobban_isbanned(M,"Syndicate"))//putting jobban check here because is_convertable uses mind as argument + if(is_convertable_to_cult(M.mind)) ticker.mode.add_cultist(M.mind) M.mind.special_role = "Cultist" M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d2ad4b9dd71..3cc77e56a1b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -431,12 +431,10 @@ var/armor_block = run_armor_check(affecting, "melee") apply_damage(damage, BRUTE, affecting, armor_block) -/mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M) - if(!istype(M)) - return 0 - for(var/L in M.contents) +/mob/living/carbon/human/proc/is_loyalty_implanted() + for(var/L in contents) if(istype(L, /obj/item/weapon/implant/loyalty)) - for(var/obj/item/organ/external/O in M.organs) + for(var/obj/item/organ/external/O in organs) if(L in O.implants) return 1 return 0 From 417c7ced5f37aab247808396fb0ad73392085b46 Mon Sep 17 00:00:00 2001 From: Markolie Date: Mon, 17 Aug 2015 19:54:22 +0200 Subject: [PATCH 2/4] Bug fixes --- code/modules/mob/living/carbon/human/human.dm | 20 ++++++++++++------- .../living/silicon/pai/software_modules.dm | 2 ++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3cc77e56a1b..a31a5fc95c7 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -694,6 +694,12 @@ // if looting pockets with gloves, do it quietly if(href_list["pockets"]) + if(isanimal(usr)) + return //animals cannot strip people + + if(target.frozen) + source << "\red Do not attempt to strip frozen people." + return var/pocket_side = href_list["pockets"] var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store) @@ -720,16 +726,19 @@ // Update strip window if(usr.machine == src && in_range(src, usr)) show_inv(usr) - - - + else if(!pickpocket) // Display a warning if the user mocks up src << "You feel your [pocket_side] pocket being fumbled with!" - // if looting id with gloves, do it quietly - this allows pickpocket gloves to take/place id stealthily - Bone White if(href_list["item"]) + if(isanimal(usr)) + return //animals cannot strip people + + if(target.frozen) + source << "\red Do not attempt to strip frozen people." + return var/itemTarget = href_list["item"] if(itemTarget == "id") if(pickpocket) @@ -762,9 +771,6 @@ // Display a warning if the user mocks up src << "You feel your ID slot being fumbled with!" - - - if (href_list["refresh"]) if((machine)&&(in_range(src, usr))) show_inv(machine) diff --git a/code/modules/mob/living/silicon/pai/software_modules.dm b/code/modules/mob/living/silicon/pai/software_modules.dm index 14a3733154d..9cba0094d4d 100644 --- a/code/modules/mob/living/silicon/pai/software_modules.dm +++ b/code/modules/mob/living/silicon/pai/software_modules.dm @@ -369,6 +369,8 @@ /mob/living/silicon/pai/proc/hackloop() var/turf/T = get_turf_or_move(src.loc) for(var/mob/living/silicon/ai/AI in player_list) + if(!T || !(T.z in config.contact_levels)) + break if(T.loc) AI << "Network Alert: Brute-force encryption crack in progress in [T.loc]." else From dc76ff1ae55af445b7b36fe19e08ba1e2c0a6b22 Mon Sep 17 00:00:00 2001 From: Markolie Date: Mon, 17 Aug 2015 20:03:57 +0200 Subject: [PATCH 3/4] Fix targets --- code/modules/mob/living/carbon/human/human.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a31a5fc95c7..68b4a936d3c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -697,8 +697,8 @@ if(isanimal(usr)) return //animals cannot strip people - if(target.frozen) - source << "\red Do not attempt to strip frozen people." + if(frozen) + usr << "\red Do not attempt to strip frozen people." return var/pocket_side = href_list["pockets"] var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) @@ -736,8 +736,8 @@ if(isanimal(usr)) return //animals cannot strip people - if(target.frozen) - source << "\red Do not attempt to strip frozen people." + if(frozen) + usr << "\red Do not attempt to strip frozen people." return var/itemTarget = href_list["item"] if(itemTarget == "id") From c91e698e24d8c074efab2b1ee66f211adeedda8c Mon Sep 17 00:00:00 2001 From: Markolie Date: Mon, 17 Aug 2015 21:20:00 +0200 Subject: [PATCH 4/4] Fix shuttle call sanitization --- code/game/machinery/computer/communications.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 66c56dd196a..5e5d62cfb4f 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -170,7 +170,7 @@ var/shuttle_call/shuttle_calls[0] message_cooldown = 0 if("callshuttle") - var/input = stripped_input(usr, "Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null + var/input = input(usr, "Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null if(!input || ..() || !(is_authenticated(usr) == 2)) nanomanager.update_uis(src) return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 75eda3ea588..e69b9057048 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -916,7 +916,7 @@ Traitors and the like can also be revived with the previous role mostly intact. choice = input("Is this an emergency evacuation or a crew transfer?") in list("Emergency", "Crew Transfer") if (choice == "Emergency") - var/reason = stripped_input(usr, "Optional: Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null + var/reason = input(usr, "Optional: Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null emergency_shuttle.call_evac(reason) else emergency_shuttle.call_transfer() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c89552719bb..3afd24a4e36 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -336,7 +336,7 @@ var/list/ai_verbs_default = list( if(check_unable(AI_CHECK_WIRELESS)) return - var/input = stripped_input(usr, "Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null + var/input = input(usr, "Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null if(!input || stat) return