[MIRROR] Removes stupid listlike var access code (#28658)

* Removes stupid listlike var access code (#84648)

## About The Pull Request

[Removes all other listlike var
accesses](https://github.com/tgstation/tgstation/pull/84648/commits/4c5996b5c8b1da63740e8b4bf998b6cb6eadac33)

Also fucking dumpsters an unused proc that allowed for arbitrary
variable modifcation. Bad juju

This is undefined behavior and errors in later 515 versions. also it's
stupid as hell

* Removes stupid listlike var access code

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-07-06 06:12:28 +02:00
committed by GitHub
parent 3b8331c316
commit 0186f4d8b0
14 changed files with 24 additions and 20 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(list(
* A list of all machinery tied to an area along with the area itself. key=area name,value=list(area,list of machinery)
* we use this to keep track of what areas are affected by the blueprints & what machinery of these areas needs to be reconfigured accordingly
*/
var/area/affected_areas = list()
var/list/area/affected_areas = list()
for(var/turf/the_turf as anything in turfs)
var/area/old_area = the_turf.loc
+1 -1
View File
@@ -370,7 +370,7 @@ GLOBAL_LIST_INIT(can_pass_info_vars, GLOBAL_PROC_REF(can_pass_check_vars))
/datum/can_pass_info/proc/compare_against(datum/can_pass_info/check_against)
for(var/comparable_var in GLOB.can_pass_info_vars)
if(!(vars[comparable_var] ~= check_against[comparable_var]))
if(!(vars[comparable_var] ~= check_against.vars[comparable_var]))
return FALSE
if(!pulling_info != !check_against.pulling_info)
return FALSE
-6
View File
@@ -1,6 +0,0 @@
/proc/overwrite_field_if_available(datum/record/base, datum/record/other, field_name)
if(other[field_name])
base[field_name] = other[field_name]
+1 -1
View File
@@ -7,7 +7,7 @@ SUBSYSTEM_DEF(research)
//TECHWEB STATIC
var/list/techweb_nodes = list() //associative id = node datum
var/list/techweb_designs = list() //associative id = node datum
var/list/datum/design/item_to_design = list() //typepath = list of design datums
var/list/list/datum/design/item_to_design = list() //typepath = list of design datums
///List of all techwebs, generating points or not.
///Autolathes, Mechfabs, and others all have shared techwebs, for example.
@@ -234,7 +234,7 @@ SUBSYSTEM_DEF(spatial_grid)
. = list()
//technically THIS list only contains lists, but inside those lists are grid cell datums and we can go without a SINGLE var init if we do this
var/list/datum/spatial_grid_cell/grid_level = grids_by_z_level[center_turf.z]
var/list/list/datum/spatial_grid_cell/grid_level = grids_by_z_level[center_turf.z]
switch(type)
if(SPATIAL_GRID_CONTENTS_TYPE_CLIENTS)
+9 -1
View File
@@ -176,7 +176,15 @@ multiple modular subtrees with behaviors
if(ai_status == AI_STATUS_OFF)
return
if(exited && (get_dist(pawn, (islist(exited) ? exited[1] : exited)) <= interesting_dist)) //is our target in between interesting cells?
var/distance = INFINITY
if(islist(exited))
var/list/exited_list = exited
distance = get_dist(pawn, exited_list[1])
else if(isatom(exited))
var/atom/exited_atom = exited
distance = get_dist(pawn, exited_atom)
if(distance <= interesting_dist) //is our target in between interesting cells?
return
if(should_idle())
+2 -1
View File
@@ -281,7 +281,8 @@
var/datum/component/C = dc[c_type]
if(C)
if(length(C))
C = C[1]
var/list/component_list = C
C = component_list[1]
if(C.type == c_type)
return C
return null
+2 -1
View File
@@ -284,8 +284,9 @@
for(var/datum/greyscale_layer/layer as anything in group)
var/icon/layer_icon
if(islist(layer))
var/list/layer_list = layer
layer_icon = GenerateLayerGroup(colors, layer, render_steps, new_icon || last_external_icon)
layer = layer[1] // When there are multiple layers in a group like this we use the first one's blend mode
layer = layer_list[1] // When there are multiple layers in a group like this we use the first one's blend mode
else
layer_icon = layer.Generate(colors, render_steps, new_icon || last_external_icon)
+1 -1
View File
@@ -1455,7 +1455,7 @@
if(response.body == "[]")
dat += "<center><b>0 bans detected for [ckey]</b></center>"
else
bans = json_decode(response["body"])
bans = json_decode(response.body)
//Ignore bans from non-whitelisted sources, if a whitelist exists
var/list/valid_sources
@@ -3,11 +3,12 @@
/proc/debug_variable(name, value, level, datum/owner, sanitize = TRUE, display_flags = NONE) //if D is a list, name will be index, and value will be assoc value.
if(owner)
if(islist(owner))
var/list/list_owner = owner
var/index = name
if (value)
name = owner[name] //name is really the index until this line
name = list_owner[name] //name is really the index until this line
else
value = owner[name]
value = list_owner[name]
. = "<li style='backgroundColor:white'>([VV_HREF_TARGET_1V(owner, VV_HK_LIST_EDIT, "E", index)]) ([VV_HREF_TARGET_1V(owner, VV_HK_LIST_CHANGE, "C", index)]) ([VV_HREF_TARGET_1V(owner, VV_HK_LIST_REMOVE, "-", index)]) "
else
. = "<li style='backgroundColor:white'>([VV_HREF_TARGET_1V(owner, VV_HK_BASIC_EDIT, "E", name)]) ([VV_HREF_TARGET_1V(owner, VV_HK_BASIC_CHANGE, "C", name)]) ([VV_HREF_TARGET_1V(owner, VV_HK_BASIC_MASSEDIT, "M", name)]) "
+1 -1
View File
@@ -1189,7 +1189,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_atoms_ontop)
if(response.errored || response.status_code != 200)
query_in_progress = FALSE
CRASH("Failed to fetch mapped custom json from url [json_url], code: [response.status_code], error: [response.error]")
var/json_data = response["body"]
var/json_data = response.body
json_cache[json_url] = json_data
query_in_progress = FALSE
return json_data
+1 -1
View File
@@ -30,7 +30,7 @@
var/canmove = TRUE
var/list/autogrant_actions_passenger //plain list of typepaths
var/list/autogrant_actions_controller //assoc list "[bitflag]" = list(typepaths)
var/list/mob/occupant_actions //assoc list mob = list(type = action datum assigned to mob)
var/list/list/datum/action/occupant_actions //assoc list mob = list(type = action datum assigned to mob)
///This vehicle will follow us when we move (like atrailer duh)
var/obj/vehicle/trailer
var/are_legs_exposed = FALSE
@@ -375,7 +375,7 @@
for(var/datum/design/design in cached_designs)
var/cost = list()
var/list/materials = design["materials"]
var/list/materials = design.materials
for(var/datum/material/mat in materials)
cost[mat.name] = OPTIMAL_COST(materials[mat] * component_coeff)
-1
View File
@@ -544,7 +544,6 @@
#include "code\__HELPERS\radio.dm"
#include "code\__HELPERS\randoms.dm"
#include "code\__HELPERS\reagents.dm"
#include "code\__HELPERS\records.dm"
#include "code\__HELPERS\ref.dm"
#include "code\__HELPERS\roundend.dm"
#include "code\__HELPERS\sanitize_values.dm"