mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
[s] sanity checks vv_edit_var() values (#52255)
cl ShizCalev fix: Added some sanity checking for varedit values. /cl * sanity checks vv_edit_var() values * this should be an or * one more fix
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
var/auto_trim = TRUE
|
||||
|
||||
/datum/config_entry/string/vv_edit_var(var_name, var_value)
|
||||
return var_name != "auto_trim" && ..()
|
||||
return var_name != NAMEOF(src, auto_trim) && ..()
|
||||
|
||||
/datum/config_entry/string/ValidateAndSet(str_val)
|
||||
if(!VASProcCallGuard(str_val))
|
||||
@@ -105,7 +105,7 @@
|
||||
return FALSE
|
||||
|
||||
/datum/config_entry/number/vv_edit_var(var_name, var_value)
|
||||
var/static/list/banned_edits = list("max_val", "min_val", "integer")
|
||||
var/static/list/banned_edits = list(NAMEOF(src, max_val), NAMEOF(src, min_val), NAMEOF(src, integer))
|
||||
return !(var_name in banned_edits) && ..()
|
||||
|
||||
/datum/config_entry/flag
|
||||
@@ -194,4 +194,4 @@
|
||||
return FALSE
|
||||
|
||||
/datum/config_entry/keyed_list/vv_edit_var(var_name, var_value)
|
||||
return var_name != "splitter" && ..()
|
||||
return var_name != NAMEOF(src, splitter) && ..()
|
||||
|
||||
@@ -261,10 +261,10 @@
|
||||
|
||||
/datum/controller/subsystem/vv_edit_var(var_name, var_value)
|
||||
switch (var_name)
|
||||
if ("can_fire")
|
||||
if (NAMEOF(src, can_fire))
|
||||
//this is so the subsystem doesn't rapid fire to make up missed ticks causing more lag
|
||||
if (var_value)
|
||||
next_fire = world.time + wait
|
||||
if ("queued_priority") //editing this breaks things.
|
||||
return 0
|
||||
if (NAMEOF(src, queued_priority)) //editing this breaks things.
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
@@ -69,9 +69,9 @@ SUBSYSTEM_DEF(blackbox)
|
||||
|
||||
/datum/controller/subsystem/blackbox/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
if("feedback")
|
||||
if(NAMEOF(src, feedback))
|
||||
return FALSE
|
||||
if("sealed")
|
||||
if(NAMEOF(src, sealed))
|
||||
if(var_value)
|
||||
return Seal()
|
||||
return FALSE
|
||||
|
||||
@@ -47,7 +47,7 @@ SUBSYSTEM_DEF(title)
|
||||
. = ..()
|
||||
if(.)
|
||||
switch(var_name)
|
||||
if("icon")
|
||||
if(NAMEOF(src, icon))
|
||||
if(splash_turf)
|
||||
splash_turf.icon = icon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user