Tweaks Load Lawset to differentiate between admins and normal players, admins can choose to not change zeroth laws (#22842)

* Naughty borgs

* I'm warning you

* typo

* Update law_manager.dm
This commit is contained in:
Vi3trice
2023-11-21 07:59:45 -05:00
committed by GitHub
parent 9d82850551
commit f70b534aee
2 changed files with 14 additions and 8 deletions
+11 -6
View File
@@ -125,12 +125,17 @@
owner.statelaws(ALs)
if("transfer_laws")
if(is_malf(usr))
var/datum/ai_laws/ALs = locate(params["transfer_laws"]) in (is_admin(usr) ? admin_laws : player_laws)
if(ALs)
log_and_message_admins("has transfered the [ALs.name] laws to [owner].")
ALs.sync(owner, 0)
current_view = 0
if(!is_malf(usr))
return
var/admin_overwrite = is_admin(usr)
var/datum/ai_laws/ALs = locate(params["transfer_laws"]) in (admin_overwrite ? admin_laws : player_laws)
if(!ALs)
return
if(admin_overwrite && alert("Do you want to overwrite [owner]'s zeroth law? If the chosen lawset has no zeroth law while [owner] has one, it will get removed!", "Load Lawset", "Yes", "No") != "Yes")
admin_overwrite = FALSE
log_and_message_admins("has transfered the [ALs.name] laws to [owner][admin_overwrite ? " and overwrote their zeroth law":""].")
ALs.sync(owner, FALSE, admin_overwrite)
current_view = 0
if("notify_laws")
to_chat(owner, "<span class='danger'>Law Notice</span>")