Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Law Manager Works Properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
DatBoiTim committed Aug 6, 2021
1 parent 230454c commit 211286a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions code/modules/nano/modules/law_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,41 +68,41 @@
return 1

if(href_list["change_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())
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)
zeroth_law = new_law
return 1

if(href_list["change_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())
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)
ion_law = new_law
return 1

if(href_list["change_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())
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)
inherent_law = new_law
return 1

if(href_list["change_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())
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)
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) && can_still_topic())
if(isnum(new_position))
supplied_law_position = Clamp(new_position, 1, MAX_SUPPLIED_LAW_NUMBER)
return 1

if(href_list["edit_law"])
if(is_malf(usr))
var/datum/ai_law/AL = locate(href_list["edit_law"]) in owner.laws.all_laws()
if(AL)
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())
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))
log_and_message_admins("has changed a law of [owner] from '[AL.law]' to '[new_law]'")
AL.law = new_law
return 1
Expand Down

0 comments on commit 211286a

Please sign in to comment.