Skip to content

Commit

Permalink
AmbiguousInOrder ODLint (#20046)
Browse files Browse the repository at this point in the history
Enabled AmbiguousInOrder OpenDream linting to error out
Fixed ambiguous orders with parenthesis to explicit orders
No player facing changes
  • Loading branch information
FluffyGhoster authored Oct 16, 2024
1 parent bec05df commit a623e22
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions code/___linters/odlint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
#pragma EmptyBlock error
#pragma SuspiciousSwitchCase error
#pragma AssignmentInConditional error
#pragma AmbiguousInOrder error

#endif
2 changes: 1 addition & 1 deletion code/controllers/subsystems/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ SUBSYSTEM_DEF(jobs)
if(SSatlas.current_sector.description)
to_chat(H, SSatlas.current_sector.get_chat_description())

if("Arrivals Shuttle" in SSatlas.current_map.allowed_spawns && spawning_at == "Arrivals Shuttle")
if(("Arrivals Shuttle" in SSatlas.current_map.allowed_spawns) && spawning_at == "Arrivals Shuttle")
H.centcomm_despawn_timer = addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living, centcomm_timeout)), 10 MINUTES, TIMER_STOPPABLE)
to_chat(H,SPAN_NOTICE("You have ten minutes to reach the station before you will be forced there."))

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/events/power_failure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in SSmachinery.smes_units)
var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || !is_station_level(S.z))
if((current_area.type in skipped_areas) || !is_station_level(S.z))
continue
S.charge = S.capacity
S.update_icon()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/telecomms/computers/logbrowser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@

var/newnet = sanitize(input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text)

if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(newnet && (((usr in range(1, src)) || issilicon(usr))))
if(length(newnet) > 15)
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font>"

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/telecomms/computers/telemonitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
if(href_list["network"])

var/newnet = sanitize(input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text)
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(newnet && (((usr in range(1, src)) || issilicon(usr))))
if(length(newnet) > 15)
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font>"

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/radio/intercom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ pixel_x = 8;
if(!istype(position) || !(position.z in levels))
return FALSE

if(input_frequency in ANTAG_FREQS && !syndie)
if((input_frequency in ANTAG_FREQS) && !syndie)
return FALSE//Prevents broadcast of messages over devices lacking the encryption

return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/traitordevices.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ effective or pretty fucking useless.
if(!istype(target))
to_chat(user, SPAN_NOTICE("[target] is not a valid target!"))
return
if(GLOB.all_languages[LANGUAGE_LIIDRA] in target.languages || target.internal_organs_by_name["blackkois"])
if((GLOB.all_languages[LANGUAGE_LIIDRA] in target.languages) || target.internal_organs_by_name["blackkois"])
to_chat(user, SPAN_NOTICE("[target] is already part of the Lii'dra Hivemind!"))
return
if(isvaurca(target))
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/random/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
)
while(!P)
P = pick(typesof(/obj/structure/flora/pottedplant))
if(P in unwanted || ((P in rare) && prob(50)))
if((P in unwanted) || ((P in rare) && prob(50)))
P = null
. = new P(loc)

Expand All @@ -465,7 +465,7 @@
)
while(!P)
P = pick(typesof(/obj/item/flora/pottedplant_small))
if(P in unwanted || ((P in rare) && prob(50)))
if((P in unwanted) || ((P in rare) && prob(50)))
P = null
. = new P(loc)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/under/accessories/badges.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
if(!istype(id_card))
return

if(ACCESS_SECURITY in id_card.access || emagged)
if((ACCESS_SECURITY in id_card.access) || emagged)
to_chat(user, "You imprint your ID details onto the badge.")
set_name(user.real_name)
else
Expand Down
4 changes: 2 additions & 2 deletions code/modules/organs/subtypes/parasite/black_kois.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@
SPAN_DANGER("You feel the cold of the knife cutting and cutting, but it is too late. There is nothing left of you but the Lii'dra's will, now. A final cut - and then you are granted the only escape that still remains to you."))
to_chat(target, SPAN_GOOD("Your function is fulfilled. We have no further need of you. Releasing control."))
target.death(FALSE) //too late, there is no brain left to save
if(GLOB.all_languages[LANGUAGE_VAURCA] in target.languages && stage >= 3 && !isvaurca(target))
if((GLOB.all_languages[LANGUAGE_VAURCA] in target.languages) && stage >= 3 && !isvaurca(target))
target.remove_language(LANGUAGE_VAURCA)
to_chat(target, SPAN_WARNING("Your mind suddenly grows dark as the unity of the Hive is torn from you."))
if(GLOB.all_languages[LANGUAGE_LIIDRA] in target.languages && stage >= 3)
if((GLOB.all_languages[LANGUAGE_LIIDRA] in target.languages) && stage >= 3)
target.remove_language(LANGUAGE_LIIDRA)
removed_langs = 0
remove_verb(owner, /mob/living/carbon/human/proc/kois_cough)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/overmap/events/event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@

/singleton/overmap_event_handler/proc/is_event_in_turf(var/datum/event/E, var/turf/T)
for(var/obj/effect/overmap/event/hazard in hazard_by_turf[T])
if(E in hazard.events && E.severity == hazard.difficulty)
if((E in hazard.events) && E.severity == hazard.difficulty)
return TRUE

/singleton/overmap_event_handler/proc/is_event_included(var/list/hazards, var/obj/effect/overmap/event/E, var/equal_or_better)//this proc is only used so it can break out of 2 loops cleanly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
//see if we've identified anyone nearby
if(world.time - last_bloodcall > bloodcall_interval && nearby_mobs.len)
var/mob/living/carbon/human/M = pop(nearby_mobs)
if(M in view(7,src) && M.health > 20)
if((M in view(7,src)) && M.health > 20)
if(prob(50))
bloodcall(M)
nearby_mobs.Add(M)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/shieldgen/shield_gen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
return
else
if(owned_capacitor)
if(!(owned_capacitor in range(1, src) && get_dir(owned_capacitor, src) == owned_capacitor.dir && owned_capacitor.anchored))
if(!((owned_capacitor in range(1, src)) && get_dir(owned_capacitor, src) == owned_capacitor.dir && owned_capacitor.anchored))
if(owned_capacitor.owned_gen == src)
owned_capacitor.owned_gen = null
owned_capacitor = null
Expand Down
2 changes: 1 addition & 1 deletion code/unit_tests/ruins_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
//See if the ruin is in the unit test groups we're supposed to run
var/is_in_unit_test_groups = FALSE
for(var/unit_test_group in tested_ruin.unit_test_groups)
if(unit_test_group in SSunit_tests_config.config["ruins_unit_test_groups"] || SSunit_tests_config.config["ruins_unit_test_groups"][1] == "*")
if((unit_test_group in SSunit_tests_config.config["ruins_unit_test_groups"]) || SSunit_tests_config.config["ruins_unit_test_groups"][1] == "*")
is_in_unit_test_groups = TRUE
break

Expand Down

0 comments on commit a623e22

Please sign in to comment.