mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Add vv_can_delete, kill last vestiges of 'forbidden objects'
This commit is contained in:
@@ -102,4 +102,7 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself.
|
||||
return 0
|
||||
|
||||
/datum/admins/vv_edit_var(var_name, var_value)
|
||||
return FALSE // no admin abuse
|
||||
return FALSE // no admin abuse
|
||||
|
||||
/datum/admins/can_vv_delete()
|
||||
return FALSE // don't break shit either
|
||||
@@ -89,8 +89,12 @@
|
||||
|
||||
if("delete")
|
||||
for(var/d in objs)
|
||||
if(!datum_is_forbidden(d))
|
||||
qdel(d)
|
||||
if(istype(d, /datum))
|
||||
var/datum/D = d
|
||||
if(!D.can_vv_delete())
|
||||
to_chat(usr, "[D] rejected your deletion")
|
||||
continue
|
||||
qdel(d)
|
||||
|
||||
if("select")
|
||||
var/text = ""
|
||||
@@ -118,9 +122,6 @@
|
||||
if("set" in query_tree)
|
||||
var/list/set_list = query_tree["set"]
|
||||
for(var/d in objs)
|
||||
// Forbid explicitly modifying an admin datum's vars
|
||||
if(datum_is_forbidden(d))
|
||||
return
|
||||
for(var/list/sets in set_list)
|
||||
var/datum/temp = d
|
||||
var/i = 0
|
||||
@@ -128,11 +129,10 @@
|
||||
if(++i == sets.len)
|
||||
if(istype(temp, /turf) && (v == "x" || v == "y" || v == "z"))
|
||||
continue
|
||||
if(!datum_is_forbidden(temp.vars[v]))
|
||||
return
|
||||
temp.vars[v] = SDQL_expression(d, set_list[sets])
|
||||
if(!temp.vv_edit_var(v, SDQL_expression(d, set_list[sets])))
|
||||
to_chat(usr, "[temp] rejected your varedit.")
|
||||
break
|
||||
if(temp.vars.Find(v) && (istype(temp.vars[v], /datum) || istype(temp.vars[v], /client)) && !datum_is_forbidden(temp.vars[v]))
|
||||
if(temp.vars.Find(v) && (istype(temp.vars[v], /datum) || istype(temp.vars[v], /client)))
|
||||
temp = temp.vars[v]
|
||||
else
|
||||
break
|
||||
@@ -440,11 +440,6 @@
|
||||
for(var/arg in arguments)
|
||||
new_args[++new_args.len] = SDQL_expression(source, arg)
|
||||
|
||||
for(var/p in forbidden_varedit_object_types)
|
||||
if(istype(object, p))
|
||||
to_chat(usr, "<span class='warning'>It is forbidden to run this object's procs.</span>")
|
||||
return
|
||||
|
||||
if(object == world) // Global proc.
|
||||
procname = "/proc/[procname]"
|
||||
return call(procname)(arglist(new_args))
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
var/list/forbidden_varedit_object_types = list(
|
||||
/datum/admins, //Admins editing their own admin-power object? Yup, sounds like a good idea.
|
||||
/obj/machinery/blackbox_recorder, //Prevents people messing with feedback gathering
|
||||
/datum/feedback_variable //Prevents people messing with feedback gathering
|
||||
)
|
||||
|
||||
var/list/VVlocked = list("vars", "var_edited", "client", "firemut", "ishulk", "telekinesis", "xray", "ka", "virus", "viruses", "cuffed", "last_eaten", "unlock_content") // R_DEBUG
|
||||
var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays", "resize") // R_EVENT | R_DEBUG
|
||||
var/list/VVckey_edit = list("key", "ckey") // R_EVENT | R_DEBUG
|
||||
var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width", "bound_x", "bound_y") // R_DEBUG + warning
|
||||
|
||||
/proc/datum_is_forbidden(type)
|
||||
for(var/p in forbidden_varedit_object_types)
|
||||
if(istype(type, p))
|
||||
to_chat(usr, "<span class='warning'>It is forbidden to tamper with this object.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/client/proc/vv_get_class(var/var_value)
|
||||
if(isnull(var_value))
|
||||
. = VV_NULL
|
||||
|
||||
@@ -588,22 +588,30 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
feedback_add_details("admin_verb","CCR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
/client/proc/cmd_admin_delete(atom/O as obj|mob|turf in view())
|
||||
/client/proc/cmd_admin_delete(atom/A as obj|mob|turf in view())
|
||||
set category = "Admin"
|
||||
set name = "Delete"
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
if(alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
|
||||
log_admin("[key_name(usr)] deleted [O] at ([O.x],[O.y],[O.z])")
|
||||
message_admins("[key_name_admin(usr)] deleted [O] at ([O.x],[O.y],[O.z])", 1)
|
||||
admin_delete(A)
|
||||
|
||||
/client/proc/admin_delete(datum/D)
|
||||
if(istype(D) && !D.can_vv_delete())
|
||||
to_chat(src, "[D] rejected your deletion")
|
||||
return
|
||||
var/atom/A = D
|
||||
var/coords = istype(A) ? "at ([A.x], [A.y], [A.z])" : ""
|
||||
if(alert(src, "Are you sure you want to delete:\n[D]\n[coords]?", "Confirmation", "Yes", "No") == "Yes")
|
||||
log_admin("[key_name(usr)] deleted [D][coords]")
|
||||
message_admins("[key_name_admin(usr)] deleted [D][coords]", 1)
|
||||
feedback_add_details("admin_verb","DEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
if(istype(O, /turf))
|
||||
var/turf/T = O
|
||||
if(isturf(D))
|
||||
var/turf/T = D
|
||||
T.ChangeTurf(/turf/space)
|
||||
return
|
||||
qdel(O)
|
||||
else
|
||||
qdel(D)
|
||||
|
||||
/client/proc/cmd_admin_list_open_jobs()
|
||||
set category = "Admin"
|
||||
|
||||
Reference in New Issue
Block a user