From 2b8d49bc1db93ee51f2f4c06ed8bb84af8995580 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 6 Aug 2021 14:14:33 -0400 Subject: [PATCH] Revert "Law Manager Works Properly." This reverts commit 211286a9ca842fcec2d4eaa35ff6402b20e2d842. --- code/modules/nano/modules/law_manager.dm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/modules/nano/modules/law_manager.dm b/code/modules/nano/modules/law_manager.dm index 389fb7a7e1..e146e6b5d0 100644 --- a/code/modules/nano/modules/law_manager.dm +++ b/code/modules/nano/modules/law_manager.dm @@ -68,32 +68,32 @@ return 1 if(href_list["change_zeroth_law"]) - var/new_law = input(usr, "Enter new law Zero. Leaving the field blank will cancel the edit.", "Edit Law") - if(new_law && new_law != zeroth_law) + var/new_law = sanitize(input("Enter new law Zero. Leaving the field blank will cancel the edit.", "Edit Law", zeroth_law)) + if(new_law && new_law != zeroth_law && can_still_topic()) zeroth_law = new_law return 1 if(href_list["change_ion_law"]) - var/new_law = input(usr, "Enter new ion law. Leaving the field blank will cancel the edit.", "Edit Law") - if(new_law && new_law != ion_law) + var/new_law = sanitize(input("Enter new ion law. Leaving the field blank will cancel the edit.", "Edit Law", ion_law)) + if(new_law && new_law != ion_law && can_still_topic()) ion_law = new_law return 1 if(href_list["change_inherent_law"]) - var/new_law = input(usr, "Enter new inherent law. Leaving the field blank will cancel the edit.", "Edit Law") - if(new_law && new_law != inherent_law) + var/new_law = sanitize(input("Enter new inherent law. Leaving the field blank will cancel the edit.", "Edit Law", inherent_law)) + if(new_law && new_law != inherent_law && can_still_topic()) inherent_law = new_law return 1 if(href_list["change_supplied_law"]) - var/new_law = input(usr, "Enter new supplied law. Leaving the field blank will cancel the edit.", "Edit Law") - if(new_law && new_law != supplied_law) + var/new_law = sanitize(input("Enter new supplied law. Leaving the field blank will cancel the edit.", "Edit Law", supplied_law)) + if(new_law && new_law != supplied_law && can_still_topic()) supplied_law = new_law return 1 if(href_list["change_supplied_law_position"]) var/new_position = input(usr, "Enter new supplied law position between 1 and [MAX_SUPPLIED_LAW_NUMBER], inclusive. Inherent laws at the same index as a supplied law will not be stated.", "Law Position", supplied_law_position) as num|null - if(isnum(new_position)) + if(isnum(new_position) && can_still_topic()) supplied_law_position = Clamp(new_position, 1, MAX_SUPPLIED_LAW_NUMBER) return 1 @@ -101,8 +101,8 @@ if(is_malf(usr)) var/datum/ai_law/AL = locate(href_list["edit_law"]) in owner.laws.all_laws() if(AL) - var/new_law = input(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law") - if(new_law && new_law != AL.law && is_malf(usr)) + var/new_law = sanitize(input(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law)) + if(new_law && new_law != AL.law && is_malf(usr) && can_still_topic()) log_and_message_admins("has changed a law of [owner] from '[AL.law]' to '[new_law]'") AL.law = new_law return 1