diff --git a/code/datums/components/riding/riding.dm b/code/datums/components/riding/riding.dm index cfdaf605878..e34e763ae83 100644 --- a/code/datums/components/riding/riding.dm +++ b/code/datums/components/riding/riding.dm @@ -195,7 +195,7 @@ if(diroffsets.len == 3) buckled_mob.layer = diroffsets[3] break dir_loop - var/list/static/default_vehicle_pixel_offsets = list(TEXT_NORTH = list(0, 0), TEXT_SOUTH = list(0, 0), TEXT_EAST = list(0, 0), TEXT_WEST = list(0, 0)) + var/static/list/default_vehicle_pixel_offsets = list(TEXT_NORTH = list(0, 0), TEXT_SOUTH = list(0, 0), TEXT_EAST = list(0, 0), TEXT_WEST = list(0, 0)) var/px = default_vehicle_pixel_offsets[AM_dir] var/py = default_vehicle_pixel_offsets[AM_dir] if(directional_vehicle_offsets[AM_dir]) diff --git a/code/datums/mutations/speech.dm b/code/datums/mutations/speech.dm index b9367cfdcdc..f487ac56c13 100644 --- a/code/datums/mutations/speech.dm +++ b/code/datums/mutations/speech.dm @@ -79,7 +79,7 @@ // Used to replace the original later var/og_word = editing_word // Iterating through each replaceable-string in the .json - var/list/static/super_wacky_words = strings("heckacious.json", "heckacious") + var/static/list/super_wacky_words = strings("heckacious.json", "heckacious") // If the word doesn't get replaced we might do something with it later var/word_edited diff --git a/code/game/objects/items/kirby_plants/kirbyplants.dm b/code/game/objects/items/kirby_plants/kirbyplants.dm index f5e550be4a7..28c1d4be341 100644 --- a/code/game/objects/items/kirby_plants/kirbyplants.dm +++ b/code/game/objects/items/kirby_plants/kirbyplants.dm @@ -19,10 +19,11 @@ var/dead = FALSE ///If it's a special named plant, set this to true to prevent dead-name overriding. var/custom_plant_name = FALSE - var/list/static/random_plant_states + var/static/list/random_plant_states /// Maximum icon state number - KEEP THIS UP TO DATE var/random_state_cap = 43 // SKYRAT EDIT ADDITION + /obj/item/kirbyplants/Initialize(mapload) . = ..() AddComponent(/datum/component/tactical) @@ -67,23 +68,25 @@ /// Cycle basic plant visuals /obj/item/kirbyplants/proc/change_visual() - if(!random_plant_states) - generate_states() + if(isnull(random_plant_states)) + random_plant_states = generate_states() var/current = random_plant_states.Find(icon_state) var/next = WRAP(current+1,1,length(random_plant_states)) base_icon_state = random_plant_states[next] update_appearance(UPDATE_ICON) /obj/item/kirbyplants/proc/generate_states() - random_plant_states = list() + var/list/plant_states = list() for(var/i in 1 to random_state_cap) //SKYRAT EDIT CHANGE - ORIGINAL: for(var/i in 1 to 24) var/number if(i < 10) number = "0[i]" else number = "[i]" - random_plant_states += "plant-[number]" - random_plant_states += list("applebush", "monkeyplant") //SKYRAT EDIT CHANGE - ORIGINAL:random_plant_states += "applebush" + plant_states += "plant-[number]" + plant_states += "applebush" + plant_states += "monkeyplant" // BUBBER EDIT ADDITION + return plant_states /obj/item/kirbyplants/random icon = 'icons/obj/fluff/flora/_flora.dmi' diff --git a/code/game/objects/structures/traps.dm b/code/game/objects/structures/traps.dm index a30a59e45a2..11f4817b94c 100644 --- a/code/game/objects/structures/traps.dm +++ b/code/game/objects/structures/traps.dm @@ -12,7 +12,7 @@ var/charges = INFINITY var/antimagic_flags = MAGIC_RESISTANCE - var/list/static/ignore_typecache + var/static/list/ignore_typecache var/list/mob/immune_minds = list() var/sparks = TRUE @@ -30,7 +30,7 @@ ) AddElement(/datum/element/connect_loc, loc_connections) - if(!ignore_typecache) + if(isnull(ignore_typecache)) ignore_typecache = typecacheof(list( /obj/effect, /mob/dead, diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index 03e53ff6f8a..f2c3be93143 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -1,3 +1,6 @@ +/// Cached global list of generated lighting sheets. See: datum/light_source/proc/get_sheet() +GLOBAL_LIST_EMPTY(lighting_sheets) + // This is where the fun begins. // These are the main datums that emit light. @@ -223,16 +226,15 @@ /// If the requested sheet is multiz, this will be 3 lists deep, first handling z level then x and y /// otherwise it's just two, x then y /datum/light_source/proc/get_sheet(multiz = FALSE) - var/list/static/key_to_sheet = list() var/range = max(1, light_range); var/key = "[range]-[visual_offset]-[offset_x]-[offset_y]-[light_dir]-[light_angle]-[light_height]-[multiz]" - var/list/hand_back = key_to_sheet[key] + var/list/hand_back = GLOB.lighting_sheets[key] if(!hand_back) if(multiz) hand_back = generate_sheet_multiz(range, visual_offset, offset_x, offset_y, light_dir, light_angle, light_height) else hand_back = generate_sheet(range, visual_offset, offset_x, offset_y, light_dir, light_angle, light_height) - key_to_sheet[key] = hand_back + GLOB.lighting_sheets[key] = hand_back return hand_back /// Returns a list of lists that encodes the light falloff of our source diff --git a/code/modules/mapping/ruins.dm b/code/modules/mapping/ruins.dm index 4987016c5a0..d6ac3ac4f94 100644 --- a/code/modules/mapping/ruins.dm +++ b/code/modules/mapping/ruins.dm @@ -31,7 +31,7 @@ testing("Ruin \"[name]\" placed at ([central_turf.x], [central_turf.y], [central_turf.z])") if(clear_below) - var/list/static/clear_below_typecache = typecacheof(list( + var/static/list/clear_below_typecache = typecacheof(list( /obj/structure/spawner, /mob/living/simple_animal, /obj/structure/flora diff --git a/code/modules/mining/boulder_processing/boulder_types.dm b/code/modules/mining/boulder_processing/boulder_types.dm index 366c5b21c42..6d0d58a1be2 100644 --- a/code/modules/mining/boulder_processing/boulder_types.dm +++ b/code/modules/mining/boulder_processing/boulder_types.dm @@ -38,7 +38,7 @@ . = ..() /// Static list of all minerals to populate gulag boulders with. - var/list/static/gulag_minerals = list( + var/static/list/gulag_minerals = list( /datum/material/diamond = 1, /datum/material/gold = 8, /datum/material/iron = 95, @@ -59,7 +59,7 @@ . = ..() /// Static list of all minerals to populate gulag boulders with, but with bluespace added where safe. - var/list/static/expanded_gulag_minerals = list( + var/static/list/expanded_gulag_minerals = list( /datum/material/bluespace = 1, /datum/material/diamond = 1, /datum/material/gold = 8, diff --git a/code/modules/projectiles/projectile/bullets/special.dm b/code/modules/projectiles/projectile/bullets/special.dm index 2af0fe7b9cb..34f6c1e0718 100644 --- a/code/modules/projectiles/projectile/bullets/special.dm +++ b/code/modules/projectiles/projectile/bullets/special.dm @@ -196,7 +196,7 @@ if(possible_victims.len) return pick(possible_victims) - var/list/static/prioritized_targets = list(/obj/structure/reagent_dispensers, /obj/item/grenade, /obj/structure/window) + var/static/list/prioritized_targets = list(/obj/structure/reagent_dispensers, /obj/item/grenade, /obj/structure/window) for(var/iter_type in prioritized_targets) for(var/already_coined_tries in 1 to 3) var/atom/iter_type_check = locate(iter_type) in valid_targets diff --git a/code/modules/spells/spell_types/conjure/simian.dm b/code/modules/spells/spell_types/conjure/simian.dm index b64a34f847e..1f1074cb981 100644 --- a/code/modules/spells/spell_types/conjure/simian.dm +++ b/code/modules/spells/spell_types/conjure/simian.dm @@ -98,7 +98,7 @@ weapon.attack_self(summoned_monkey) // Fashionable ape wear, organised by tier - var/list/static/monky_hats = list( + var/static/list/monky_hats = list( null, // nothin here /obj/item/clothing/head/costume/garland, /obj/item/clothing/head/helmet/durathread, diff --git a/tools/ci/check_grep.sh b/tools/ci/check_grep.sh index 8a2b715502f..05718cfccd8 100644 --- a/tools/ci/check_grep.sh +++ b/tools/ci/check_grep.sh @@ -140,6 +140,13 @@ if $grep '^/[\w/]\S+\(.*(var/|, ?var/.*).*\)' $code_files; then st=1 fi; +part "improperly pathed static lists" +if $grep -i 'var/list/static/.*' $code_files; then + echo + echo -e "${RED}ERROR: Found incorrect static list definition 'var/list/static/', it should be 'var/static/list/' instead.${NC}" + st=1 +fi; + part "can_perform_action argument check" if $grep 'can_perform_action\(\s*\)' $code_files; then echo