diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 4c205efdea2..320ba8425dd 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -242,17 +242,17 @@ */ /datum/proc/GetExactComponent(datum/component/c_type) RETURN_TYPE(c_type) - if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE) + var/initial_type_mode = initial(c_type.dupe_mode) + if(initial_type_mode == COMPONENT_DUPE_ALLOWED || initial_type_mode == COMPONENT_DUPE_SELECTIVE) stack_trace("GetComponent was called to get a component of which multiple copies could be on an object. This can easily break and should be changed. Type: \[[c_type]\]") - var/list/dc = _datum_components - if(!dc) + var/list/all_components = _datum_components + if(!all_components) return null - var/datum/component/C = dc[c_type] - if(C) - if(length(C)) - C = C[1] - if(C.type == c_type) - return C + var/datum/component/potential_component + if(length(all_components)) + potential_component = all_components[c_type] + if(potential_component?.type == c_type) + return potential_component return null /** diff --git a/code/datums/greyscale/_greyscale_config.dm b/code/datums/greyscale/_greyscale_config.dm index 1bc56a5d524..774fde610fd 100644 --- a/code/datums/greyscale/_greyscale_config.dm +++ b/code/datums/greyscale/_greyscale_config.dm @@ -144,8 +144,9 @@ if(length(colors) < expected_colors) CRASH("[DebugName()] expected [expected_colors] color arguments but only received [length(colors)]") if(islist(layer)) + var/list/layer_list = layer layer_icon = GenerateLayerGroup(colors, layer, render_steps) - 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, src) if(!new_icon) diff --git a/code/modules/admin/panels/permission_panel.dm b/code/modules/admin/panels/permission_panel.dm index c8573d2b57d..ccf54694efb 100644 --- a/code/modules/admin/panels/permission_panel.dm +++ b/code/modules/admin/panels/permission_panel.dm @@ -214,7 +214,7 @@ . = ckey(admin_key) if(!.) return FALSE - if(!admin_ckey && (. in GLOB.admin_datums+GLOB.deadmins)) + if(!admin_ckey && (. in (GLOB.admin_datums+GLOB.deadmins))) to_chat(usr, span_danger("[admin_key] is already an admin.")) return FALSE if(use_db) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index acba414f1f6..3f617d74cdf 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -125,7 +125,7 @@ Status: [status ? status : "Unknown"] | Damage: [health ? health : "None"] if(response.body == "[]") dat += "
0 bans detected for [ckey]
" else - bans = json_decode(response["body"]) + bans = json_decode(response.body) dat += "
[length(bans)] ban\s detected for [ckey]
" for(var/list/ban in bans) dat += "Server: [sanitize(ban["sourceName"])]
" diff --git a/code/modules/admin/verbs/datumvars.dm b/code/modules/admin/verbs/datumvars.dm index 7b0068eebfe..a6006ec45da 100644 --- a/code/modules/admin/verbs/datumvars.dm +++ b/code/modules/admin/verbs/datumvars.dm @@ -532,18 +532,19 @@ #define VV_HTML_ENCODE(thing) (sanitize ? html_encode(thing) : thing) -/proc/debug_variable(name, value, level, datum/DA = null, sanitize = TRUE) +/proc/debug_variable(name, value, level, datum/owner = null, sanitize = TRUE) var/header - if(DA) - if(islist(DA)) + if(owner) + if(islist(owner)) + var/list/list_owner = owner var/index = name if(value) - name = DA[name] //name is really the index until this line + name = list_owner[name] //name is really the index until this line else - value = DA[name] - header = "
  • (E) (C) (-) " + value = list_owner[name] + header = "
  • (E) (C) (-) " else - header = "
  • (E) (C) (M) " + header = "
  • (E) (C) (M) " else header = "
  • " @@ -571,7 +572,7 @@ var/list/L = value var/list/items = list() - if(istype(DA, /datum/controller/global_vars) && !DA.vv_edit_var(name, L)) + if(istype(owner, /datum/controller/global_vars) && !owner.vv_edit_var(name, L)) item = "[VV_HTML_ENCODE(name)] = /list ([length(L)])" else if(length(L) > 0 && !(name == "underlays" || name == "overlays" || length(L) > (IS_NORMAL_LIST(L) ? 50 : 150))) for(var/i in 1 to length(L)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 0376cbc8726..87af1763fd5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -578,7 +578,7 @@ conga_line += S.buckled while(!end_of_conga) var/atom/movable/A = S.pulling - if(A in conga_line || A.anchored) //No loops, nor moving anchored things. + if((A in conga_line) || A.anchored) //No loops, nor moving anchored things. end_of_conga = TRUE break conga_line += A diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index bb5997aca9e..7197a28b951 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -101,25 +101,25 @@ switch(screen) if(0) dat+= "
    " - dat+= "
    Remove [(istype(src[page], /obj/item/paper)) ? "paper" : "photo"]
    " + dat+= "
    Remove [(istype(page, /obj/item/paper)) ? "paper" : "photo"]
    " dat+= "
    Next Page


    " if(1) dat+= "
    Previous Page
    " - dat+= "
    Remove [(istype(src[page], /obj/item/paper)) ? "paper" : "photo"]
    " + dat+= "
    Remove [(istype(page, /obj/item/paper)) ? "paper" : "photo"]
    " dat+= "
    Next Page


    " if(2) dat+= "
    Previous Page
    " - dat+= "
    Remove [(istype(src[page], /obj/item/paper)) ? "paper" : "photo"]


    " + dat+= "
    Remove [(istype(page, /obj/item/paper)) ? "paper" : "photo"]


    " dat+= "
    " - if(istype(src[page], /obj/item/paper)) - var/obj/item/paper/P = src[page] + if(istype(page, /obj/item/paper)) + var/obj/item/paper/P = page if(!(ishuman(usr) || isobserver(usr) || issilicon(usr))) dat+= "[P.name][stars(P.info)][P.stamps]" else dat+= "[P.name][P.info][P.stamps]" human_user << browse(dat, "window=[name]") - else if(istype(src[page], /obj/item/photo)) - var/obj/item/photo/P = src[page] + else if(istype(page, /obj/item/photo)) + var/obj/item/photo/P = page human_user << browse_rsc(P.picture.picture_icon, "tmp_photo.png") human_user << browse(dat + "[P.name]" \ + "" \ diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 13a9ae9a836..5bc55e70d38 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -312,7 +312,7 @@ for(var/obj/machinery/power/smes/S in GLOB.machines) var/area/current_area = get_area(S) - if(current_area.type in skipped_areas || !is_mainship_level(S.z)) // Ship only + if((current_area.type in skipped_areas) || !is_mainship_level(S.z)) // Ship only continue S.charge = 0 S.output_level = 0 @@ -336,7 +336,7 @@ for(var/obj/machinery/power/smes/S in GLOB.machines) var/area/current_area = get_area(S) - if(current_area.type in skipped_areas || !is_mainship_level(S.z)) + if((current_area.type in skipped_areas) || !is_mainship_level(S.z)) continue S.charge = S.capacity S.output_level = S.output_level_max diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index 7fb96481346..72fad6cf035 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -189,6 +189,6 @@ GLOB.marine_main_ship.revoke_maint_all_access() /obj/machinery/door/airlock/allowed(mob/M) - if(is_mainship_level(z) && GLOB.marine_main_ship.maint_all_access && (ACCESS_MARINE_ENGINEERING in req_access+req_one_access)) + if(is_mainship_level(z) && GLOB.marine_main_ship.maint_all_access && (ACCESS_MARINE_ENGINEERING in (req_access+req_one_access))) return TRUE return ..(M) diff --git a/tools/ci/od_lints.dm b/tools/ci/od_lints.dm index e339f5acb2d..710a13e2492 100644 --- a/tools/ci/od_lints.dm +++ b/tools/ci/od_lints.dm @@ -12,7 +12,6 @@ #pragma SoftReservedKeyword error #pragma DuplicateVariable error #pragma DuplicateProcDefinition error -#pragma TooManyArguments error #pragma PointlessParentCall error #pragma PointlessBuiltinCall error #pragma SuspiciousMatrixCall error