From 6fbda4e5b3f3ff61b62499527d25520d0be1f4c0 Mon Sep 17 00:00:00 2001 From: Geeves Date: Sun, 14 Jun 2020 10:25:47 +0200 Subject: [PATCH] AI Law Message Fix (#9120) --- code/datums/ai_laws.dm | 5 +++++ code/game/objects/items/weapons/AI_modules.dm | 4 ++++ code/modules/mob/living/silicon/ai/laws.dm | 4 +++- html/changelogs/geeves-ai_vr_laws_fix.yml | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/geeves-ai_vr_laws_fix.yml diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index fb152cefa8c..be64b35287a 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -226,10 +226,15 @@ var/global/const/base_law_type = /datum/ai_laws/nanotrasen for(var/datum/ai_law/law in sorted_laws) if(law == zeroth_law_borg) continue + var/mob/M = who if(law == zeroth_law) to_chat(who, "[law.get_index()]. [law.law]") + if(ismob(who) && M.vr_mob) + to_chat(M.vr_mob, "[law.get_index()]. [law.law]") else to_chat(who, "[law.get_index()]. [law.law]") + if(ismob(who) && M.vr_mob) + to_chat(M.vr_mob, "[law.get_index()]. [law.law]") /******************** * Stating Laws * diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index f4b80655adb..7be17e70860 100755 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -45,10 +45,14 @@ AI MODULES else src.transmitInstructions(comp.current, usr) to_chat(comp.current, "These are your laws now:") + if(comp.current.vr_mob) + to_chat(comp.current.vr_mob, "These are your laws now:") comp.current.show_laws() for(var/mob/living/silicon/robot/R in mob_list) if(R.law_update && (R.connected_ai == comp.current)) to_chat(R, "These are your laws now:") + if(R.vr_mob) + to_chat(R.vr_mob, "These are your laws now:") R.show_laws() to_chat(usr, "Upload complete. The AI's laws have been modified.") diff --git a/code/modules/mob/living/silicon/ai/laws.dm b/code/modules/mob/living/silicon/ai/laws.dm index f1c16b19046..6c8d75a8320 100755 --- a/code/modules/mob/living/silicon/ai/laws.dm +++ b/code/modules/mob/living/silicon/ai/laws.dm @@ -10,7 +10,9 @@ who = world else who = src - to_chat(who, "Obey these laws:") + to_chat(src, "Obey these laws:") + if(vr_mob) + to_chat(vr_mob, "Obey these laws:") src.laws_sanity_check() src.laws.show_laws(who) diff --git a/html/changelogs/geeves-ai_vr_laws_fix.yml b/html/changelogs/geeves-ai_vr_laws_fix.yml new file mode 100644 index 00000000000..fdc7c7da252 --- /dev/null +++ b/html/changelogs/geeves-ai_vr_laws_fix.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "AI currently remotely controlling things will now receive law update messages." \ No newline at end of file