[MIRROR] Gets rid of = new in object defines (#11075)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-06-15 10:25:06 -07:00
committed by GitHub
parent 7872b8bf3c
commit 2653dac7da
30 changed files with 98 additions and 75 deletions

View File

@@ -216,7 +216,7 @@
/proc/difflist(var/list/first, var/list/second, var/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))
@@ -265,7 +265,7 @@ Checks if a list has the same entries and values as an element of big.
/proc/uniquemergelist(var/list/first, var/list/second, var/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

View File

@@ -1463,7 +1463,7 @@ var/mob/dview/dview_mob
return pre_generated_list
/proc/filter_fancy_list(list/L, filter as text)
var/list/matches = new
var/list/matches = list()
for(var/key in L)
var/value = L[key]
if(findtext("[key]", filter) || findtext("[value]", filter))

View File

@@ -18,11 +18,14 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new
var/deny_shuttle = 0 //allows admins to prevent the shuttle from being called
var/departed = 0 //if the shuttle has left the station at least once
var/datum/announcement/priority/emergency_shuttle_docked = new(0, new_sound = sound('sound/AI/shuttledock.ogg'))
var/datum/announcement/priority/emergency_shuttle_called = new(0, new_sound = sound('sound/AI/shuttlecalled.ogg'))
var/datum/announcement/priority/emergency_shuttle_recalled = new(0, new_sound = sound('sound/AI/shuttlerecalled.ogg'))
var/datum/announcement/priority/emergency_shuttle_docked
var/datum/announcement/priority/emergency_shuttle_called
var/datum/announcement/priority/emergency_shuttle_recalled
/datum/emergency_shuttle_controller/New()
emergency_shuttle_docked = new(0, new_sound = sound('sound/AI/shuttledock.ogg'))
emergency_shuttle_called = new(0, new_sound = sound('sound/AI/shuttlecalled.ogg'))
emergency_shuttle_recalled = new(0, new_sound = sound('sound/AI/shuttlerecalled.ogg'))
escape_pods = list()
..()

View File

@@ -159,7 +159,7 @@ var/global/datum/controller/subsystem/ticker/ticker
if(hide_mode)
to_world(span_world(span_notice("The current game mode is - Secret!")))
if(runnable_modes.len)
var/list/tmpmodes = new
var/list/tmpmodes = list()
for (var/datum/game_mode/M in runnable_modes)
tmpmodes+=M.name
tmpmodes = sortList(tmpmodes)

View File

@@ -4,11 +4,7 @@
/datum/events
var/list/events
/datum/events/New()
..()
events = new
var/list/events = list()
/datum/events/proc/addEventType(event_type as text)
if(!(event_type in events) || !islist(events[event_type]))

View File

@@ -45,7 +45,7 @@
var/rev_cooldown = 0
var/tcrystals = 0
var/list/purchase_log = new
var/list/purchase_log = list()
var/used_TC = 0
var/list/learned_recipes //List of learned recipe TYPES.

View File

@@ -39,7 +39,7 @@
/datum/receptions
var/obj/machinery/message_server/message_server = null
var/sender_reception = TELECOMMS_RECEPTION_NONE
var/list/receiver_reception = new
var/list/receiver_reception = list()
/proc/get_message_server()
if(message_servers)

View File

@@ -373,7 +373,7 @@ GLOBAL_LIST_EMPTY(areas_by_type)
//////////////////////////////////////////////////////////////////
var/list/mob/living/forced_ambiance_list = new
var/list/mob/living/forced_ambiance_list = list()
/area/Entered(mob/M)
if(!istype(M) || !M.ckey)

View File

@@ -997,8 +997,8 @@ var/list/sacrificed = list()
if (istype(H.current,/mob/living/carbon))
cultists+=H.current
*/
var/list/cultists = new //also, wording for it is old wording for obscure rune, which is now hide-see-blood.
var/list/victims = new
var/list/cultists = list() //also, wording for it is old wording for obscure rune, which is now hide-see-blood.
var/list/victims = list()
// var/list/cultboil = list(cultists-usr) //and for this words are destroy-see-blood.
for(var/mob/living/carbon/C in orange(1,src))
if(iscultist(C) && !C.stat)

View File

@@ -31,7 +31,7 @@
var/nextstate = null
var/net_id
var/list/areas_added
var/list/users_to_open = new
var/list/users_to_open = list()
var/next_process_time = 0
var/hatch_open = 0

View File

@@ -247,7 +247,7 @@ GLOBAL_LIST(construction_frame_floor)
/obj/structure/frame/proc/update_desc()
var/D
if(req_components)
var/list/component_list = new
var/list/component_list = list()
for(var/I in req_components)
if(req_components[I] > 0)
component_list += "[num2text(req_components[I])] [req_component_names[I]]"

View File

@@ -103,7 +103,7 @@
NEWSCASTER.newsAlert(annoncement)
NEWSCASTER.update_icon()
// var/list/receiving_pdas = new
// var/list/receiving_pdas = list()
// for (var/obj/item/pda/P in PDAs)
// if(!P.owner)
// continue

View File

@@ -52,11 +52,11 @@ GLOBAL_LIST_EMPTY_TYPED(allConsoles, /obj/machinery/requests_console)
var/recipient = ""; //the department which will be receiving the message
var/priority = -1 ; //Priority of the message being sent
light_range = 0
var/datum/announcement/announcement = new
var/datum/announcement/announcement
/obj/machinery/requests_console/Initialize(mapload)
. = ..()
announcement = new
announcement.title = "[department] announcement"
announcement.newscast = 1

View File

@@ -31,7 +31,7 @@ var/list/ai_status_emotions = list(
)
/proc/get_ai_emotions(var/ckey)
var/list/emotions = new
var/list/emotions = list()
for(var/emotion_name in ai_status_emotions)
var/datum/ai_emotion/emotion = ai_status_emotions[emotion_name]
if(!emotion.ckey || emotion.ckey == ckey)

View File

@@ -75,7 +75,7 @@
if(!S)
break
if(step_towards(S,trg))
var/list/mobs = new
var/list/mobs = list()
for(var/mob/living/carbon/M in S.loc)
mobs += M
var/mob/living/carbon/M = safepick(mobs)

View File

@@ -34,13 +34,13 @@
var/obj/item/cell/cell
var/state = MECHA_OPERATING
var/list/log = new
var/list/log = list()
var/last_message = 0
var/add_req_access = 1
var/maint_access = 1
var/dna //Dna-locking the mech
var/list/proc_res = list() //Stores proc owners, like proc_res["functionname"] = owner reference
var/datum/effect/effect/system/spark_spread/spark_system = new
var/datum/effect/effect/system/spark_spread/spark_system
var/lights = 0
var/lights_power = 6
var/force = 0
@@ -72,7 +72,7 @@
var/wreckage
var/list/equipment = new //This lists holds what stuff you bolted onto your baby ride
var/list/equipment = list() //This lists holds what stuff you bolted onto your baby ride
var/obj/item/mecha_parts/mecha_equipment/selected
var/max_equip = 2
@@ -84,11 +84,11 @@
var/current_processes = MECHA_PROC_INT_TEMP
//mechaequipt2 stuffs
var/list/hull_equipment = new
var/list/weapon_equipment = new
var/list/utility_equipment = new
var/list/universal_equipment = new
var/list/special_equipment = new
var/list/hull_equipment = list()
var/list/weapon_equipment = list()
var/list/utility_equipment = list()
var/list/universal_equipment = list()
var/list/special_equipment = list()
var/max_hull_equip = 2
var/max_weapon_equip = 2
var/max_utility_equip = 2
@@ -151,33 +151,56 @@
var/smoke_reserve = 5 //How many shots you have. Might make a reload later on. MIGHT.
var/smoke_ready = 1 //This is a check for the whether or not the cooldown is ongoing.
var/smoke_cooldown = 100 //How long you have between uses.
var/datum/effect/effect/system/smoke_spread/smoke_system = new
var/datum/effect/effect/system/smoke_spread/smoke_system
var/cloak_possible = FALSE // Can this exosuit innately cloak?
////All of those are for the HUD buttons in the top left. See Grant and Remove procs in mecha_actions.
var/datum/action/innate/mecha/mech_eject/eject_action = new
var/datum/action/innate/mecha/mech_toggle_internals/internals_action = new
var/datum/action/innate/mecha/mech_toggle_lights/lights_action = new
var/datum/action/innate/mecha/mech_view_stats/stats_action = new
var/datum/action/innate/mecha/strafe/strafing_action = new
var/datum/action/innate/mecha/mech_eject/eject_action
var/datum/action/innate/mecha/mech_toggle_internals/internals_action
var/datum/action/innate/mecha/mech_toggle_lights/lights_action
var/datum/action/innate/mecha/mech_view_stats/stats_action
var/datum/action/innate/mecha/strafe/strafing_action
var/datum/action/innate/mecha/mech_defence_mode/defence_action = new
var/datum/action/innate/mecha/mech_overload_mode/overload_action = new
var/datum/action/innate/mecha/mech_smoke/smoke_action = new
var/datum/action/innate/mecha/mech_zoom/zoom_action = new
var/datum/action/innate/mecha/mech_toggle_thrusters/thrusters_action = new
var/datum/action/innate/mecha/mech_cycle_equip/cycle_action = new
var/datum/action/innate/mecha/mech_switch_damtype/switch_damtype_action = new
var/datum/action/innate/mecha/mech_toggle_phasing/phasing_action = new
var/datum/action/innate/mecha/mech_toggle_cloaking/cloak_action = new
var/datum/action/innate/mecha/mech_defence_mode/defence_action
var/datum/action/innate/mecha/mech_overload_mode/overload_action
var/datum/action/innate/mecha/mech_smoke/smoke_action
var/datum/action/innate/mecha/mech_zoom/zoom_action
var/datum/action/innate/mecha/mech_toggle_thrusters/thrusters_action
var/datum/action/innate/mecha/mech_cycle_equip/cycle_action
var/datum/action/innate/mecha/mech_switch_damtype/switch_damtype_action
var/datum/action/innate/mecha/mech_toggle_phasing/phasing_action
var/datum/action/innate/mecha/mech_toggle_cloaking/cloak_action
var/weapons_only_cycle = FALSE //So combat mechs don't switch to their equipment at times.
//Micro Mech Code
var/max_micro_utility_equip = 0
var/max_micro_weapon_equip = 0
var/list/micro_utility_equipment = list()
var/list/micro_weapon_equipment = list()
/obj/mecha/Initialize(mapload)
. = ..()
//All this used to be set to =new on the object itself which...bad.
eject_action = new
internals_action = new
lights_action = new
stats_action = new
strafing_action = new
defence_action = new
overload_action = new
smoke_action = new
zoom_action = new
thrusters_action = new
cycle_action = new
switch_damtype_action = new
phasing_action = new
cloak_action = new
for(var/path in starting_components)
var/obj/item/mecha_parts/component/C = new path(src)
C.attach(src)
@@ -198,9 +221,11 @@
removeVerb(/obj/mecha/verb/connect_to_port)
removeVerb(/obj/mecha/verb/toggle_internal_tank)
spark_system = new
spark_system.set_up(2, 0, src)
spark_system.attach(src)
smoke_system = new
if(smoke_possible)//I am pretty sure that's needed here.
src.smoke_system.set_up(3, 0, src)
src.smoke_system.attach(src)

View File

@@ -1,12 +1,4 @@
/* //CHOMPedit commented micromech stuff, because fuck this trash
/obj/mecha
var/max_micro_utility_equip = 0
var/max_micro_weapon_equip = 0
var/list/micro_utility_equipment = new
var/list/micro_weapon_equipment = new
/obj/mecha/micro
icon = 'icons/mecha/micro.dmi'
force = 10 //still a robot

View File

@@ -110,11 +110,12 @@
pixel_y = -16
/obj/effect/abstract/directional_lighting
var/obj/effect/abstract/light_spot/light_spot = new
var/obj/effect/abstract/light_spot/light_spot
var/trans_angle
var/icon_dist
/obj/effect/abstract/directional_lighting/Initialize(mapload)
light_spot = new
. = ..()
vis_contents += light_spot

View File

@@ -246,7 +246,7 @@
/obj/item/blueprints/proc/detect_room_ex(var/turf/first, var/allowedAreas = AREA_SPACE)
if(!istype(first))
return ROOM_ERR_LOLWAT
var/list/turf/found = new
var/list/turf/found = list()
var/list/turf/pending = list(first)
while(pending.len)
if (found.len+pending.len > 300)

View File

@@ -671,7 +671,7 @@
return ROOM_ERR_LOLWAT
if(!visual && forbiddenAreas[first.loc.type] || forbiddenAreas[first.type]) //Is the area of the starting turf a banned area? Is the turf a banned area?
return ROOM_ERR_FORBIDDEN
var/list/turf/found = new
var/list/turf/found = list()
var/list/turf/pending = list(first)
while(pending.len)
if (found.len+pending.len > BP_MAX_ROOM_SIZE)
@@ -828,7 +828,7 @@
to_chat(usr, span_warning("You can not create a room here."))
return
if(get_new_area_type(first.loc) == 1) //Are they in an area they can build? I tried to do this BUILDABLE_AREA_TYPES[first.loc.type] but it refused.
var/list/turf/found = new
var/list/turf/found = list()
var/list/turf/pending = list(first)
while(pending.len)
if (found.len+pending.len > 70)

View File

@@ -35,7 +35,7 @@
for(var/reagent in picked_reagents)
reagents.add_reagent(reagent, picked_reagents[reagent])
var/list/names = new
var/list/names = list()
for(var/datum/reagent/R in reagents.reagent_list)
names += R.name

View File

@@ -67,7 +67,7 @@ var/global/list/default_medbay_channels = list(
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
/obj/item/radio/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
@@ -76,6 +76,7 @@ var/global/list/default_medbay_channels = list(
/obj/item/radio/Initialize(mapload)
. = ..()
secure_radio_connections = new
if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ)
frequency = sanitize_frequency(frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
set_frequency(frequency)

View File

@@ -18,13 +18,13 @@
var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
var/obj/item/cell/cell //Our power source
var/state = 0
var/list/log = new
var/list/log = list()
var/last_message = 0
var/add_req_access = 1
var/maint_access = 1
//var/dna //dna-locking the mech
var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
var/datum/effect/effect/system/spark_spread/spark_system = new
var/datum/effect/effect/system/spark_spread/spark_system
var/lights = 0
var/lights_power = 6
@@ -46,7 +46,7 @@
var/wreckage
var/list/equipment = new
var/list/equipment = list()
var/obj/selected
//var/max_equip = 3
@@ -58,6 +58,7 @@
icon_state += "-unmanned"
add_radio()
spark_system = new
spark_system.set_up(2, 0, src)
spark_system.attach(src)
add_cell()

View File

@@ -826,7 +826,7 @@ CHOMP Remove end */
/proc/detect_room_buildmode(var/turf/first, var/allowedAreas = AREA_SPACE)
if(!istype(first))
return
var/list/turf/found = new
var/list/turf/found = list()
var/list/turf/pending = list(first)
while(pending.len)
var/turf/T = pending[1]

View File

@@ -64,7 +64,7 @@ var/list/department_radio_keys = list(
)
var/list/channel_to_radio_key = new
var/list/channel_to_radio_key = list()
/proc/get_radio_key_from_channel(var/channel)
var/key = channel_to_radio_key[channel]
if(!key)

View File

@@ -48,7 +48,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 == 1) rval += C

View File

@@ -126,7 +126,7 @@
var/datum/hud/hud_used = null
var/list/grabbed_by = list( )
var/list/grabbed_by = list()
var/list/mapobjs = list()

View File

@@ -12,7 +12,11 @@
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
network_destination = "long-range communication array"
category = PROG_COMMAND
var/datum/comm_message_listener/message_core = new
var/datum/comm_message_listener/message_core
/datum/computer_file/program/comm/New(var/obj/item/modular_computer/comp = null)
..()
message_core = new
/datum/computer_file/program/comm/clone()
var/datum/computer_file/program/comm/temp = ..()

View File

@@ -15,7 +15,7 @@
Var: tokens
A list of tokens in the source code generated by a scanner.
*/
var/list/tokens = new
var/list/tokens = list()
/*
Var: errors
A list of fatal errors found by the parser. If there are any items in this list, then it is not safe to run the returned AST.
@@ -23,12 +23,12 @@
See Also:
- <scriptError>
*/
var/list/errors = new
var/list/errors = list()
/*
Var: warnings
A list of non-fatal problems in the script.
*/
var/list/warnings = new
var/list/warnings = list()
/*
Var: curToken
The token at <index> in <tokens>.

View File

@@ -14,12 +14,12 @@
See Also:
- <scriptError>
*/
var/list/errors = new
var/list/errors = list()
/*
Var: warnings
A list of non-fatal problems in the source code found by the scanner.
*/
var/list/warnings = new
var/list/warnings = list()
/*
Proc: LoadCode
@@ -84,7 +84,7 @@
Variable: delim
A list of characters that denote the start of a new token. This list is automatically populated.
*/
var/list/delim = new
var/list/delim = list()
/*
Macro: COL