Merge pull request #12798 from LetterN/vunerability-bad

[s] Ports lots of vunerability fix
This commit is contained in:
silicons
2020-07-16 09:32:58 -07:00
committed by GitHub
30 changed files with 78 additions and 61 deletions
@@ -83,7 +83,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, during_load)
if(!VASProcCallGuard(str_val))
@@ -110,7 +110,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
@@ -216,7 +216,7 @@
return FALSE
/datum/config_entry/keyed_list/vv_edit_var(var_name, var_value)
return var_name != "splitter" && ..()
return var_name != NAMEOF(src, splitter) && ..()
/datum/config_entry/keyed_list/proc/preprocess_key(key)
return key
+3 -3
View File
@@ -210,10 +210,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
. = ..()
+2 -2
View File
@@ -60,9 +60,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
+2 -2
View File
@@ -47,7 +47,7 @@ SUBSYSTEM_DEF(title)
. = ..()
if(.)
switch(var_name)
if("icon")
if(NAMEOF(src, icon))
if(splash_turf)
splash_turf.icon = icon
@@ -66,4 +66,4 @@ SUBSYSTEM_DEF(title)
icon = SStitle.icon
splash_turf = SStitle.splash_turf
file_path = SStitle.file_path
previous_icon = SStitle.previous_icon
previous_icon = SStitle.previous_icon
+1 -1
View File
@@ -105,7 +105,7 @@
/// Proc specifically for inserting items, returns the amount of materials entered.
/datum/component/material_container/proc/insert_item(obj/item/I, var/multiplier = 1, stack_amt)
if(!I)
if(QDELETED(I))
return FALSE
multiplier = CEILING(multiplier, 0.01)
+1 -1
View File
@@ -741,7 +741,7 @@
flags_1 |= ADMIN_SPAWNED_1
. = ..()
switch(var_name)
if("color")
if(NAMEOF(src, color))
add_atom_colour(color, ADMIN_COLOUR_PRIORITY)
/atom/vv_get_dropdown()
+4 -4
View File
@@ -120,25 +120,25 @@
if((var_name in careful_edits) && (var_value % world.icon_size) != 0)
return FALSE
switch(var_name)
if("x")
if(NAMEOF(src, x))
var/turf/T = locate(var_value, y, z)
if(T)
forceMove(T)
return TRUE
return FALSE
if("y")
if(NAMEOF(src, y))
var/turf/T = locate(x, var_value, z)
if(T)
forceMove(T)
return TRUE
return FALSE
if("z")
if(NAMEOF(src, z))
var/turf/T = locate(x, y, var_value)
if(T)
forceMove(T)
return TRUE
return FALSE
if("loc")
if(NAMEOF(src, loc))
if(istype(var_value, /atom))
forceMove(var_value)
return TRUE
+1 -1
View File
@@ -188,7 +188,7 @@
/obj/machinery/door/airlock/vv_edit_var(var_name)
. = ..()
switch (var_name)
if ("cyclelinkeddir")
if (NAMEOF(src, cyclelinkeddir))
cyclelinkairlock()
/obj/machinery/door/airlock/check_access_ntnet(datum/netdata/data)
+1 -1
View File
@@ -287,7 +287,7 @@
if(!.)
return
switch(var_name)
if("shuttle_id")
if(NAMEOF(src, shuttle_id))
update()
/obj/machinery/status_display/shuttle/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override)
+1 -1
View File
@@ -224,7 +224,7 @@
. = ..()
if(.)
switch(var_name)
if("assignment","registered_name")
if(NAMEOF(src, assignment),NAMEOF(src, registered_name)) //,NAMEOF(src, registered_age))
update_label()
/obj/item/card/id/attack_self(mob/user)
+1 -5
View File
@@ -37,13 +37,9 @@
if("anchored")
setAnchored(vval)
return TRUE
if("obj_flags")
if(NAMEOF(src, obj_flags))
if ((obj_flags & DANGEROUS_POSSESSION) && !(vval & DANGEROUS_POSSESSION))
return FALSE
if("control_object")
var/obj/O = vval
if(istype(O) && (O.obj_flags & DANGEROUS_POSSESSION))
return FALSE
return ..()
/obj/Initialize()
+1 -1
View File
@@ -83,7 +83,7 @@
. = ..()
if(.)
switch(var_name)
if("icon")
if(NAMEOF(src, icon))
SStitle.icon = icon
/turf/closed/indestructible/riveted
+5 -5
View File
@@ -55,7 +55,7 @@
if(AH)
message_admins("[key_name_admin(src)] has started replying to [key_name(C, 0, 0)]'s admin help.")
var/msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as message|null
var/msg = stripped_multiline_input(src,"Message:", "Private message to [key_name(C, 0, 0)]")
if (!msg)
message_admins("[key_name_admin(src)] has cancelled their reply to [key_name(C, 0, 0)]'s admin help.")
return
@@ -87,10 +87,10 @@
if(irc)
if(!ircreplyamount) //to prevent people from spamming irc
if(!ircreplyamount) //to prevent people from spamming irc/discord
return
if(!msg)
msg = input(src,"Message:", "Private message to Administrator") as text|null
msg = stripped_multiline_input(src,"Message:", "Private message to Administrator")
if(!msg)
return
@@ -112,7 +112,7 @@
//get message text, limit it's length.and clean/escape html
if(!msg)
msg = input(src,"Message:", "Private message to [key_name(recipient, 0, 0)]") as message|null
msg = stripped_multiline_input(src,"Message:", "Private message to [key_name(recipient, 0, 0)]")
msg = trim(msg)
if(!msg)
return
@@ -191,7 +191,7 @@
spawn() //so we don't hold the caller proc up
var/sender = src
var/sendername = key
var/reply = input(recipient, msg,"Admin PM from-[sendername]", "") as text|null //show message and await a reply
var/reply = stripped_multiline_input(recipient, msg,"Admin PM from-[sendername]", "") //show message and await a reply
if(recipient && reply)
if(sender)
recipient.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them
+1 -1
View File
@@ -399,13 +399,13 @@
return FALSE
/obj/structure/lattice/catwalk/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
. = ..()
var/turf/here = get_turf(src)
for(var/A in here.contents)
var/obj/structure/cable/C = A
if(istype(C))
to_chat(S, "<span class='warning'>Disrupting the power grid would bring no benefit to us. Aborting.</span>")
return FALSE
return ..()
/obj/item/deactivated_swarmer/IntegrateAmount()
return 50
+4 -4
View File
@@ -891,13 +891,13 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
/client/vv_edit_var(var_name, var_value)
switch (var_name)
if ("holder")
if (NAMEOF(src, holder))
return FALSE
if ("ckey")
if (NAMEOF(src, ckey))
return FALSE
if ("key")
if (NAMEOF(src, key))
return FALSE
if("view")
if(NAMEOF(src, view))
change_view(var_value)
return TRUE
. = ..()
+2 -2
View File
@@ -24,7 +24,7 @@
/area/vv_edit_var(var_name, var_value)
switch(var_name)
if("dynamic_lighting")
if(NAMEOF(src, dynamic_lighting))
set_dynamic_lighting(var_value)
return TRUE
return ..()
return ..()
+3 -3
View File
@@ -89,17 +89,17 @@
/atom/vv_edit_var(var_name, var_value)
switch (var_name)
if ("light_range")
if (NAMEOF(src, light_range))
set_light(l_range=var_value)
datum_flags |= DF_VAR_EDITED
return TRUE
if ("light_power")
if (NAMEOF(src, light_power))
set_light(l_power=var_value)
datum_flags |= DF_VAR_EDITED
return TRUE
if ("light_color")
if (NAMEOF(src, light_color))
set_light(l_color=var_value)
datum_flags |= DF_VAR_EDITED
return TRUE
@@ -98,6 +98,8 @@
process_ore(AM)
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/stack/ore/O)
if(QDELETED(O))
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
if(!materials.has_space(material_amount))
@@ -57,6 +57,8 @@
. += "<span class='notice'>The status display reads: Smelting <b>[ore_multiplier]</b> sheet(s) per piece of ore.<br>Reward point generation at <b>[point_upgrade*100]%</b>.<br>Ore pickup speed at <b>[ore_pickup_rate]</b>.</span>"
/obj/machinery/mineral/ore_redemption/proc/smelt_ore(obj/item/stack/ore/O)
if(QDELETED(O))
return
var/datum/component/material_container/mat_container = materials.mat_container
if (!mat_container)
return
+4
View File
@@ -92,6 +92,8 @@
return ..()
/obj/machinery/mineral/stacking_machine/HasProximity(atom/movable/AM)
if(QDELETED(AM))
return
if(istype(AM, /obj/item/stack/sheet) && AM.loc == get_step(src, input_dir))
process_sheet(AM)
@@ -104,6 +106,8 @@
return TRUE
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
if(QDELETED(inp))
return
var/key = inp.merge_type
var/obj/item/stack/sheet/storage = stack_list[key]
if(!storage) //It's the first of this sheet added
+2
View File
@@ -123,3 +123,5 @@
bag_to_use = new(src) //make a new bag if we can't find or use the old one.
unload_mineral(bag_to_use) //just forcemove memes.
O.forceMove(bag_to_use) //don't bother sending the signal, the new bag is empty and all that.
SSblackbox.record_feedback("amount", "coins_minted", 1)
+4 -4
View File
@@ -837,13 +837,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/vv_edit_var(var_name, var_value)
. = ..()
switch(var_name)
if("icon")
if(NAMEOF(src, icon))
ghostimage_default.icon = icon
ghostimage_simple.icon = icon
if("icon_state")
if(NAMEOF(src, icon_state))
ghostimage_default.icon_state = icon_state
ghostimage_simple.icon_state = icon_state
if("fun_verbs")
if(NAMEOF(src, fun_verbs))
if(fun_verbs)
verbs += /mob/dead/observer/verb/boo
verbs += /mob/dead/observer/verb/possess
@@ -925,7 +925,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/vv_edit_var(var_name, var_value)
. = ..()
if(var_name == "invisibility")
if(var_name == NAMEOF(src, invisibility))
set_invisibility(invisibility) // updates light
/proc/set_observer_default_invisibility(amount, message=null)
+9 -10
View File
@@ -1196,30 +1196,29 @@
/mob/living/vv_edit_var(var_name, var_value)
switch(var_name)
if ("maxHealth")
if (NAMEOF(src, maxHealth))
if (!isnum(var_value) || var_value <= 0)
return FALSE
if("stat")
if(NAMEOF(src, stat))
if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life
GLOB.dead_mob_list -= src
GLOB.alive_mob_list += src
if((stat < DEAD) && (var_value == DEAD))//Kill he
GLOB.alive_mob_list -= src
GLOB.dead_mob_list += src
if(NAMEOF(src, health)) //this doesn't work. gotta use procs instead.
return FALSE
. = ..()
switch(var_name)
if("eye_blind")
if(NAMEOF(src, eye_blind))
set_blindness(var_value)
if("eye_damage")
var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES)
E?.setOrganDamage(var_value)
if("eye_blurry")
if(NAMEOF(src, eye_blurry))
set_blurriness(var_value)
if("maxHealth")
if(NAMEOF(src, maxHealth))
updatehealth()
if("resize")
if(NAMEOF(src, resize))
update_transform()
if("lighting_alpha")
if(NAMEOF(src, lighting_alpha))
sync_lighting_plane_alpha()
/mob/living/proc/do_adrenaline(
@@ -144,6 +144,10 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache)
/// Handles the special case of editing the movement var
/mob/vv_edit_var(var_name, var_value)
if(var_name == NAMEOF(src, control_object))
var/obj/O = var_name
if(!istype(O) || (O.obj_flags & DANGEROUS_POSSESSION))
return FALSE
var/slowdown_edit = (var_name == NAMEOF(src, cached_multiplicative_slowdown))
var/diff
if(slowdown_edit && isnum(cached_multiplicative_slowdown) && isnum(var_value))
+8
View File
@@ -50,6 +50,14 @@
name = "folder - '[inputvalue]'"
/obj/item/folder/Destroy()
for(var/obj/important_thing in contents)
if(!(important_thing.resistance_flags & INDESTRUCTIBLE))
continue
important_thing.forceMove(drop_location()) //don't destroy round critical content such as objective documents.
return ..()
/obj/item/folder/attack_self(mob/user)
var/dat = "<title>[name]</title>"
+1 -1
View File
@@ -45,7 +45,7 @@
/obj/item/stock_parts/cell/vv_edit_var(var_name, var_value)
switch(var_name)
if("self_recharge")
if(NAMEOF(src, self_recharge))
if(var_value)
START_PROCESSING(SSobj, src)
else
+1 -1
View File
@@ -290,7 +290,7 @@
/obj/item/gun/energy/vv_edit_var(var_name, var_value)
switch(var_name)
if("selfcharge")
if(NAMEOF(src, selfcharge))
if(var_value)
START_PROCESSING(SSobj, src)
else
+2 -2
View File
@@ -83,6 +83,6 @@
/obj/item/gun/magic/vv_edit_var(var_name, var_value)
. = ..()
switch (var_name)
if ("charges")
switch(var_name)
if(NAMEOF(src, charges))
recharge_newshot()
+2 -2
View File
@@ -68,7 +68,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
. = ..()
/obj/machinery/conveyor/vv_edit_var(var_name, var_value)
if (var_name == "id")
if (var_name == NAMEOF(src, id))
// if "id" is varedited, update our list membership
LAZYREMOVE(GLOB.conveyors_by_id[id], src)
. = ..()
@@ -243,7 +243,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
. = ..()
/obj/machinery/conveyor_switch/vv_edit_var(var_name, var_value)
if (var_name == "id")
if (var_name == NAMEOF(src, id))
// if "id" is varedited, update our list membership
LAZYREMOVE(GLOB.conveyors_by_id[id], src)
. = ..()
+1 -1
View File
@@ -201,6 +201,6 @@
/obj/docking_port/mobile/arrivals/vv_edit_var(var_name, var_value)
switch(var_name)
if("perma_docked")
if(NAMEOF(src, perma_docked))
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("arrivals shuttle", "[var_value ? "stopped" : "started"]"))
return ..()