mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Changes over all instances of new/list() to something more sensible (#25569)
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
/proc/circlerange(center=usr,radius=3)
|
||||
|
||||
var/turf/centerturf = get_turf(center)
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
var/rsq = radius * (radius+0.5)
|
||||
|
||||
for(var/atom/T in range(radius, centerturf))
|
||||
@@ -71,7 +71,7 @@
|
||||
/proc/circleview(center=usr,radius=3)
|
||||
|
||||
var/turf/centerturf = get_turf(center)
|
||||
var/list/atoms = new/list()
|
||||
var/list/atoms = list()
|
||||
var/rsq = radius * (radius+0.5)
|
||||
|
||||
for(var/atom/A in view(radius, centerturf))
|
||||
@@ -107,7 +107,7 @@
|
||||
/proc/circle_edge_turfs(center = usr, radius = 3) // Get the turfs on the edge of a circle. Currently only works for radius 3
|
||||
|
||||
var/turf/centerturf = get_turf(center)
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
var/rsq = radius * (radius+0.5)
|
||||
|
||||
for(var/turf/T in range(radius, centerturf))
|
||||
@@ -122,7 +122,7 @@
|
||||
/proc/circleviewturfs(center = usr, radius = 3) // All the turfs in a circle of the radius
|
||||
|
||||
var/turf/centerturf = get_turf(center)
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
var/rsq = radius * (radius+0.5)
|
||||
|
||||
for(var/turf/T in view(radius, centerturf))
|
||||
@@ -135,7 +135,7 @@
|
||||
/proc/circlerangeturfs(center = usr, radius = 3)
|
||||
|
||||
var/turf/centerturf = get_turf(center)
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
var/rsq = radius * (radius + 0.5)
|
||||
|
||||
for(var/turf/T in range(radius, centerturf))
|
||||
|
||||
+10
-10
@@ -173,7 +173,7 @@
|
||||
/proc/difflist(list/first, list/second, skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
var/list/result = list()
|
||||
if(skiprep)
|
||||
for(var/e in first)
|
||||
if(!(e in result) && !(e in second))
|
||||
@@ -191,7 +191,7 @@
|
||||
/proc/uniquemergelist(list/first, list/second, skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
var/list/result = list()
|
||||
if(skiprep)
|
||||
result = difflist(first, second, skiprep)+difflist(second, first, skiprep)
|
||||
else
|
||||
@@ -297,7 +297,7 @@
|
||||
/proc/mergeKey(list/client/L, list/client/R, order = 1)
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
var/list/result = list()
|
||||
while(Li <= length(L) && Ri <= length(R))
|
||||
var/client/rL = L[Li]
|
||||
var/client/rR = R[Ri]
|
||||
@@ -323,7 +323,7 @@
|
||||
if(!L || !R) return 0
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
var/list/result = list()
|
||||
while(Li <= length(L) && Ri <= length(R))
|
||||
var/atom/rL = L[Li]
|
||||
var/atom/rR = R[Ri]
|
||||
@@ -352,7 +352,7 @@
|
||||
/proc/mergeRecordLists(list/datum/data/record/L, list/datum/data/record/R, field = "name", order = 1)
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
var/list/result = list()
|
||||
if(!isnull(L) && !isnull(R))
|
||||
while(Li <= length(L) && Ri <= length(R))
|
||||
var/datum/data/record/rL = L[Li]
|
||||
@@ -385,7 +385,7 @@
|
||||
/proc/mergeLists(list/L, list/R)
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
var/list/result = list()
|
||||
while(Li <= length(L) && Ri <= length(R))
|
||||
if(sorttext(L[Li], R[Ri]) < 1)
|
||||
result += R[Ri++]
|
||||
@@ -407,7 +407,7 @@
|
||||
/proc/mergeKeyedLists(list/L, list/R, key)
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
var/list/result = list()
|
||||
while(Li <= length(L) && Ri <= length(R))
|
||||
if(sorttext(L[Li][key], R[Ri][key]) < 1)
|
||||
// Works around list += list2 merging lists; it's not pretty but it works
|
||||
@@ -432,7 +432,7 @@
|
||||
/proc/mergeAssoc(list/L, list/R)
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
var/list/result = list()
|
||||
while(Li <= length(L) && Ri <= length(R))
|
||||
if(sorttext(L[Li], R[Ri]) < 1)
|
||||
result += R&R[Ri++]
|
||||
@@ -519,7 +519,7 @@
|
||||
/proc/dd_mergeObjectList(list/L, list/R, list/cache)
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
var/list/result = list()
|
||||
while(Li <= length(L) && Ri <= length(R))
|
||||
var/LLi = L[Li]
|
||||
var/RRi = R[Ri]
|
||||
@@ -569,7 +569,7 @@
|
||||
// This works by going to the half-point of the list, seeing if the node in question is higher or lower cost,
|
||||
// then going halfway up or down the list and checking again.
|
||||
// This is a very fast way to sort an item into a list.
|
||||
var/list/sorted_text = new()
|
||||
var/list/sorted_text = list()
|
||||
var/low_index
|
||||
var/high_index
|
||||
var/insert_index
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
var/list/viewscales = getviewsize(view)
|
||||
var/countx = CEILING((viewscales[1] / 2) * parallax_scaler, 1) + 1
|
||||
var/county = CEILING((viewscales[2] / 2) * parallax_scaler, 1) + 1
|
||||
var/list/new_overlays = new
|
||||
var/list/new_overlays = list()
|
||||
for(var/x in -countx to countx)
|
||||
for(var/y in -county to county)
|
||||
if(x == 0 && y == 0)
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
return new /datum/game_mode/extended()
|
||||
|
||||
/datum/configuration_section/gamemode_configuration/proc/get_runnable_modes()
|
||||
var/list/datum/game_mode/runnable_modes = new
|
||||
var/list/datum/game_mode/runnable_modes = list()
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = new T()
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
SSjobs.DivideOccupations() //Distribute jobs
|
||||
|
||||
if(hide_mode)
|
||||
var/list/modes = new
|
||||
var/list/modes = list()
|
||||
for(var/datum/game_mode/M in runnable_modes)
|
||||
modes += M.name
|
||||
modes = sortList(modes)
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
/datum/ai_laws/proc/laws_to_state()
|
||||
sort_laws()
|
||||
var/list/statements = new()
|
||||
var/list/statements = list()
|
||||
for(var/datum/ai_law/law in sorted_laws)
|
||||
if(get_state_law(law))
|
||||
statements += law
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
permeability_mod = 0.75
|
||||
severity = MINOR
|
||||
/// A mapping of `num2text(SLOT_HUD_XYZ)` -> item path
|
||||
var/list/magic_fashion = new
|
||||
var/list/magic_fashion = list()
|
||||
|
||||
|
||||
/datum/disease/wizarditis/New()
|
||||
@@ -62,7 +62,7 @@
|
||||
return // Woe, wizard xeno upon ye
|
||||
|
||||
// Which slots can we replace?
|
||||
var/list/eligible_slot_IDs = new
|
||||
var/list/eligible_slot_IDs = list()
|
||||
for(var/slot in magic_fashion)
|
||||
var/slot_ID = text2num(slot) // Convert back to numeric defines
|
||||
|
||||
|
||||
+2
-2
@@ -1707,8 +1707,8 @@
|
||||
|
||||
S.team = team
|
||||
|
||||
var/list/obj/effect/landmark/abductor/agent_landmarks = new
|
||||
var/list/obj/effect/landmark/abductor/scientist_landmarks = new
|
||||
var/list/obj/effect/landmark/abductor/agent_landmarks = list()
|
||||
var/list/obj/effect/landmark/abductor/scientist_landmarks = list()
|
||||
agent_landmarks.len = 4
|
||||
scientist_landmarks.len = 4
|
||||
for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list)
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
/proc/select_recipe(list/datum/recipe/available_recipes, obj/obj, exact = INGREDIENT_CHECK_EXACT, list/ignored_items = null)
|
||||
if(!exact)
|
||||
exact = -1
|
||||
var/list/datum/recipe/possible_recipes = new
|
||||
var/list/datum/recipe/possible_recipes = list()
|
||||
for(var/datum/recipe/recipe in available_recipes)
|
||||
if(recipe.check_reagents(obj.reagents) == exact && recipe.check_items(obj, ignored_items) == exact)
|
||||
possible_recipes += recipe
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
playsound(get_turf(user), sound1, 50, TRUE)
|
||||
|
||||
for(var/mob/living/target in targets)
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in range(target,outer_tele_radius))
|
||||
if(T in range(target,inner_tele_radius)) continue
|
||||
if(isspaceturf(T) && !include_space) continue
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
if(!step_towards(mechsyringe,trg))
|
||||
break
|
||||
|
||||
var/list/mobs = new
|
||||
var/list/mobs = list()
|
||||
for(var/mob/living/carbon/M in mechsyringe.loc)
|
||||
mobs += M
|
||||
var/mob/living/carbon/M = safepick(mobs)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
var/obj/structure/mecha_wreckage/wreckage = null // type that the mecha becomes when destroyed
|
||||
|
||||
var/list/equipment = new
|
||||
var/list/equipment = list()
|
||||
var/obj/item/mecha_parts/mecha_equipment/selected
|
||||
var/max_equip = 3
|
||||
var/turf/crashing = null
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
armor = list(MELEE = 40, BULLET = 20, LASER = 10, ENERGY = 20, BOMB = 40, RAD = 0, FIRE = 100, ACID = 100)
|
||||
max_equip = 6
|
||||
wreckage = /obj/structure/mecha_wreckage/ripley
|
||||
var/list/cargo = new
|
||||
var/list/cargo = list()
|
||||
var/cargo_capacity = 15
|
||||
|
||||
/// How many goliath hides does the Ripley have? Does not stack with other armor
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
|
||||
|
||||
/obj/item/areaeditor/proc/detect_room(turf/first)
|
||||
var/list/turf/found = new
|
||||
var/list/turf/found = list()
|
||||
var/list/turf/pending = list(first)
|
||||
while(length(pending))
|
||||
if(found.len+length(pending) > 300)
|
||||
|
||||
@@ -77,7 +77,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
|
||||
var/list/internal_channels
|
||||
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/list/datum/radio_frequency/secure_radio_connections = new
|
||||
var/list/datum/radio_frequency/secure_radio_connections = list()
|
||||
|
||||
var/requires_tcomms = FALSE // Does this device require tcomms to work.If TRUE it wont function at all without tcomms. If FALSE, it will work without tcomms, just slowly
|
||||
var/instant = FALSE // Should this device instantly communicate if there isnt tcomms
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
var/mob/living/M = user
|
||||
var/turf/mobloc = get_turf(M)
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
var/found_turf = FALSE
|
||||
var/list/bagholding = user.search_contents_for(/obj/item/storage/backpack/holding)
|
||||
for(var/turf/T in range(user, tp_range))
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
if(dirty)
|
||||
dat = {"<code>This [src] is dirty!<BR>Please clean it before use!</code>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
var/list/items_counts = list()
|
||||
var/list/items_measures = list()
|
||||
var/list/items_measures_p = list()
|
||||
for(var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if(istype(O,/obj/item/food/snacks/egg))
|
||||
|
||||
@@ -428,7 +428,7 @@
|
||||
|
||||
/// Returns the adjacent turfs. Can check for density or cardinal directions only instead of all 8, or just dense turfs entirely. dense_only takes precedence over open_only.
|
||||
/turf/proc/AdjacentTurfs(open_only = FALSE, cardinal_only = FALSE, dense_only = FALSE)
|
||||
var/list/L = new()
|
||||
var/list/L = list()
|
||||
var/turf/T
|
||||
var/list/directions = cardinal_only ? GLOB.cardinal : GLOB.alldirs
|
||||
for(var/dir in directions)
|
||||
|
||||
@@ -716,7 +716,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
return
|
||||
|
||||
var/list/types = typesof(/atom)
|
||||
var/list/matches = new()
|
||||
var/list/matches = list()
|
||||
|
||||
var/include_subtypes = TRUE
|
||||
if(copytext(object, -1) == ".")
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon_keyboard = "atmos_key"
|
||||
circuit = /obj/item/circuitboard/area_atmos
|
||||
|
||||
var/list/connectedscrubbers = new()
|
||||
var/list/connectedscrubbers = list()
|
||||
var/status = ""
|
||||
|
||||
var/range = 25
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
var/list/organ_data = list()
|
||||
var/list/rlimb_data = list()
|
||||
|
||||
var/list/player_alt_titles = new() // the default name of a job like "Medical Doctor"
|
||||
var/list/player_alt_titles = list() // the default name of a job like "Medical Doctor"
|
||||
var/flavor_text = ""
|
||||
var/med_record = ""
|
||||
var/sec_record = ""
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
SEND_SIGNAL(src, COMSIG_HUMAN_UPDATE_DNA)
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_species(check_whitelist = TRUE, list/whitelist = list(), list/blacklist = list())
|
||||
var/list/valid_species = new()
|
||||
var/list/valid_species = list()
|
||||
for(var/current_species_name in GLOB.all_species)
|
||||
if(check_whitelist && !check_rights(R_ADMIN, FALSE, src)) //If we're using the whitelist, make sure to check it!
|
||||
if(length(whitelist) && !(current_species_name in whitelist))
|
||||
@@ -363,7 +363,7 @@
|
||||
return sortTim(valid_species, GLOBAL_PROC_REF(cmp_text_asc))
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_hairstyles()
|
||||
var/list/valid_hairstyles = new()
|
||||
var/list/valid_hairstyles = list()
|
||||
var/obj/item/organ/external/head/H = get_organ("head")
|
||||
if(!H)
|
||||
return //No head, no hair.
|
||||
@@ -389,7 +389,7 @@
|
||||
return sortTim(valid_hairstyles, GLOBAL_PROC_REF(cmp_text_asc))
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_facial_hairstyles()
|
||||
var/list/valid_facial_hairstyles = new()
|
||||
var/list/valid_facial_hairstyles = list()
|
||||
var/obj/item/organ/external/head/H = get_organ("head")
|
||||
if(!H)
|
||||
return //No head, no hair.
|
||||
@@ -416,7 +416,7 @@
|
||||
return sortTim(valid_facial_hairstyles, GLOBAL_PROC_REF(cmp_text_asc))
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_head_accessories()
|
||||
var/list/valid_head_accessories = new()
|
||||
var/list/valid_head_accessories = list()
|
||||
var/obj/item/organ/external/head/H = get_organ("head")
|
||||
if(!H)
|
||||
return //No head, no head accessory.
|
||||
@@ -431,7 +431,7 @@
|
||||
return sortTim(valid_head_accessories, GLOBAL_PROC_REF(cmp_text_asc))
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_markings(location = "body")
|
||||
var/list/valid_markings = new()
|
||||
var/list/valid_markings = list()
|
||||
var/obj/item/organ/external/head/H = get_organ("head")
|
||||
if(!H && location == "head")
|
||||
return //No head, no head markings.
|
||||
|
||||
@@ -1492,7 +1492,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
|
||||
update_body()
|
||||
|
||||
/mob/living/carbon/human/proc/get_overlays_copy(list/unwantedLayers)
|
||||
var/list/out = new
|
||||
var/list/out = list()
|
||||
for(var/i=1;i<=TOTAL_LAYERS;i++)
|
||||
if(overlays_standing[i])
|
||||
if(i in unwantedLayers)
|
||||
|
||||
@@ -439,7 +439,7 @@
|
||||
|
||||
/datum/species/golem/bluespace/proc/reactive_teleport(mob/living/carbon/human/H)
|
||||
H.visible_message("<span class='warning'>[H] teleports!</span>", "<span class='danger'>You destabilize and teleport!</span>")
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in orange(tele_range, H))
|
||||
if(T.density)
|
||||
continue
|
||||
@@ -521,7 +521,7 @@
|
||||
/datum/action/innate/unstable_teleport/proc/teleport(mob/living/carbon/human/H)
|
||||
activated = FALSE
|
||||
H.visible_message("<span class='warning'>[H] teleports!</span>", "<span class='danger'>You teleport!</span>")
|
||||
var/list/turfs = new/list()
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in orange(tele_range, H))
|
||||
if(isspaceturf(T))
|
||||
continue
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
return parts
|
||||
|
||||
/mob/living/silicon/robot/proc/get_damageable_components()
|
||||
var/list/rval = new
|
||||
var/list/rval = list()
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed)
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/proc/law_channels()
|
||||
var/list/channels = new()
|
||||
var/list/channels = list()
|
||||
channels += MAIN_CHANNEL
|
||||
var/obj/item/radio/radio = get_radio()
|
||||
channels += radio.channels
|
||||
|
||||
@@ -476,7 +476,7 @@
|
||||
pulse2.anchored = TRUE
|
||||
pulse2.dir = pick(GLOB.cardinal)
|
||||
QDEL_IN(pulse2, 1 SECONDS)
|
||||
var/list/mob/living/carbon/targets = new
|
||||
var/list/mob/living/carbon/targets = list()
|
||||
for(var/mob/living/carbon/C in view(12,src))
|
||||
if(C.stat==2)
|
||||
continue
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
// based on say code
|
||||
var/omsg = replacetext(message, "<B>[src]</B> ", "")
|
||||
var/list/listening_obj = new
|
||||
var/list/listening_obj = list()
|
||||
for(var/atom/movable/A in view(range, src))
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
@@ -545,7 +545,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
* Mobs out of view but in range will be listed as unknown. Else they will have their visible name
|
||||
*/
|
||||
/mob/proc/get_telepathic_targets()
|
||||
var/list/validtargets = new /list()
|
||||
var/list/validtargets = list() /list()
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/mobs_in_view = get_visible_mobs()
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
force = 5
|
||||
var/list/grenades = new/list()
|
||||
var/list/grenades = list()
|
||||
var/max_grenades = 3
|
||||
|
||||
materials = list(MAT_METAL=2000)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
/datum/reagents
|
||||
/// All contained reagents. More specifically, references to the reagent datums.
|
||||
var/list/datum/reagent/reagent_list = new/list()
|
||||
var/list/datum/reagent/reagent_list = list()
|
||||
/// The total volume of all reagents in this holder.
|
||||
var/total_volume = 0
|
||||
/// This is the maximum volume of the holder.
|
||||
@@ -31,8 +31,8 @@
|
||||
var/chem_temp = T20C
|
||||
var/temperature_min = 0
|
||||
var/temperature_max = 10000
|
||||
var/list/datum/reagent/addiction_list = new/list()
|
||||
var/list/addiction_threshold_accumulated = new/list()
|
||||
var/list/datum/reagent/addiction_list = list()
|
||||
var/list/addiction_threshold_accumulated = list()
|
||||
var/flags
|
||||
|
||||
/datum/reagents/New(maximum = 100, temperature_minimum, temperature_maximum)
|
||||
@@ -463,7 +463,7 @@
|
||||
var/total_matching_catalysts = 0
|
||||
var/matching_container = FALSE
|
||||
var/matching_other = FALSE
|
||||
var/list/multipliers = new/list()
|
||||
var/list/multipliers = list()
|
||||
var/min_temp = C.min_temp //Minimum temperature required for the reaction to occur (heat to/above this)
|
||||
var/max_temp = C.max_temp //Maximum temperature allowed for the reaction to occur (cool to/below this)
|
||||
for(var/B in C.required_reagents)
|
||||
@@ -819,7 +819,7 @@
|
||||
if(R.id == id)
|
||||
return R
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
/datum/reagents/proc/remove_all_type(reagent_type, amount, strict = FALSE, safety = TRUE) // Removes all reagent of X type. @strict set to 1 determines whether the childs of the type are included.
|
||||
if(!isnum(amount))
|
||||
|
||||
Reference in New Issue
Block a user