From afb07b78321ac2e164205a005b0cb9edbefe2610 Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Thu, 25 Apr 2024 23:23:08 -0700 Subject: [PATCH 1/4] Initial --- .../objects/items/devices/data_detector.dm | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/code/game/objects/items/devices/data_detector.dm b/code/game/objects/items/devices/data_detector.dm index 6a358ec09bd8..31522b219c12 100644 --- a/code/game/objects/items/devices/data_detector.dm +++ b/code/game/objects/items/devices/data_detector.dm @@ -17,7 +17,6 @@ /obj/structure/machinery/computer/objective, /obj/item/limb/head/synth, ) - var/detect_empty_vial_boxes = FALSE /obj/item/device/motiondetector/intel/get_help_text() . = "Green indicators on your HUD will show the location of intelligence objects detected by the scanner. Has two modes: slow long-range [SPAN_HELPFUL("(14 tiles)")] and fast short-range [SPAN_HELPFUL("(7 tiles)")]." @@ -43,22 +42,19 @@ var/detected for(var/DT in objects_to_detect) if(istype(I, DT)) - if(!detect_empty_vial_boxes && istype(I, /obj/item/storage/fancy/vials/random)) - if(!I.contents) - continue - detected = TRUE + if((istype(I, /obj/item/storage/fancy/vials/random) && !I.contents.len) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents.total_volume)) + break //We don't need to ping already looted containers + else + detected = TRUE if(I.contents) for(var/obj/item/CI in I.contents) if(istype(CI, DT)) - if(!detect_empty_vial_boxes && istype(I, /obj/item/storage/fancy/vials/random)) - if(!I.contents) - continue - detected = TRUE - break + if((istype(I, /obj/item/storage/fancy/vials/random) && !I.contents.len) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents.total_volume)) + break + else + detected = TRUE if(human_user && detected) show_blip(human_user, I) - if(detected) - break if(detected) detected_sound = TRUE @@ -76,13 +72,10 @@ for(var/obj/I in M.contents_twice()) for(var/DT in objects_to_detect) if(istype(I, DT)) - if(!detect_empty_vial_boxes && istype(I, /obj/item/storage/fancy/vials/random)) - if(!I.contents) - continue - detected = TRUE - break - if(detected) - break + if((istype(I, /obj/item/storage/fancy/vials/random) && !I.contents.len) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents.total_volume)) + break + else + detected = TRUE if(human_user && detected) show_blip(human_user, M) From c457cf1d35d5b22f27ea644e47ec2e0a5893b46f Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Sat, 27 Apr 2024 02:14:30 -0700 Subject: [PATCH 2/4] Guh --- code/game/objects/items/devices/data_detector.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/devices/data_detector.dm b/code/game/objects/items/devices/data_detector.dm index 31522b219c12..97a82a63659d 100644 --- a/code/game/objects/items/devices/data_detector.dm +++ b/code/game/objects/items/devices/data_detector.dm @@ -49,7 +49,7 @@ if(I.contents) for(var/obj/item/CI in I.contents) if(istype(CI, DT)) - if((istype(I, /obj/item/storage/fancy/vials/random) && !I.contents.len) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents.total_volume)) + if((istype(CI, /obj/item/storage/fancy/vials/random) && !CI.contents.len) || (istype(CI, /obj/item/reagent_container/glass/beaker/vial/random) && !CI.reagents.total_volume)) break else detected = TRUE From 118307e36161f4a283a2e02cf51836d6efe51383 Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Mon, 6 May 2024 20:24:45 -0700 Subject: [PATCH 3/4] Update data_detector.dm --- code/game/objects/items/devices/data_detector.dm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/devices/data_detector.dm b/code/game/objects/items/devices/data_detector.dm index 97a82a63659d..cc4b1326d298 100644 --- a/code/game/objects/items/devices/data_detector.dm +++ b/code/game/objects/items/devices/data_detector.dm @@ -42,17 +42,15 @@ var/detected for(var/DT in objects_to_detect) if(istype(I, DT)) - if((istype(I, /obj/item/storage/fancy/vials/random) && !I.contents.len) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents.total_volume)) + if((istype(I, /obj/item/storage/fancy/vials/random) && !length(I.contents)) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents?.total_volume)) break //We don't need to ping already looted containers - else - detected = TRUE + detected = TRUE if(I.contents) for(var/obj/item/CI in I.contents) if(istype(CI, DT)) - if((istype(CI, /obj/item/storage/fancy/vials/random) && !CI.contents.len) || (istype(CI, /obj/item/reagent_container/glass/beaker/vial/random) && !CI.reagents.total_volume)) + if((istype(CI, /obj/item/storage/fancy/vials/random) && !length(CI.contents)) || (istype(CI, /obj/item/reagent_container/glass/beaker/vial/random) && !CI.reagents?.total_volume)) break - else - detected = TRUE + detected = TRUE if(human_user && detected) show_blip(human_user, I) @@ -72,10 +70,9 @@ for(var/obj/I in M.contents_twice()) for(var/DT in objects_to_detect) if(istype(I, DT)) - if((istype(I, /obj/item/storage/fancy/vials/random) && !I.contents.len) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents.total_volume)) + if((istype(I, /obj/item/storage/fancy/vials/random) && !length(I.contents)) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents?.total_volume)) break - else - detected = TRUE + detected = TRUE if(human_user && detected) show_blip(human_user, M) From a51fc6e81aba7c0f363ff01ce01cbc98b43b018e Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Fri, 10 May 2024 02:16:42 -0700 Subject: [PATCH 4/4] Break up long checks --- code/game/objects/items/devices/data_detector.dm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/devices/data_detector.dm b/code/game/objects/items/devices/data_detector.dm index cc4b1326d298..fe4b9cde0ab5 100644 --- a/code/game/objects/items/devices/data_detector.dm +++ b/code/game/objects/items/devices/data_detector.dm @@ -42,13 +42,17 @@ var/detected for(var/DT in objects_to_detect) if(istype(I, DT)) - if((istype(I, /obj/item/storage/fancy/vials/random) && !length(I.contents)) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents?.total_volume)) + if(istype(I, /obj/item/storage/fancy/vials/random) && !length(I.contents)) + break //We don't need to ping already looted containers + if(istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents?.total_volume) break //We don't need to ping already looted containers detected = TRUE if(I.contents) for(var/obj/item/CI in I.contents) if(istype(CI, DT)) - if((istype(CI, /obj/item/storage/fancy/vials/random) && !length(CI.contents)) || (istype(CI, /obj/item/reagent_container/glass/beaker/vial/random) && !CI.reagents?.total_volume)) + if(istype(CI, /obj/item/storage/fancy/vials/random) && !length(CI.contents)) + break + if(istype(CI, /obj/item/reagent_container/glass/beaker/vial/random) && !CI.reagents?.total_volume) break detected = TRUE if(human_user && detected) @@ -70,7 +74,9 @@ for(var/obj/I in M.contents_twice()) for(var/DT in objects_to_detect) if(istype(I, DT)) - if((istype(I, /obj/item/storage/fancy/vials/random) && !length(I.contents)) || (istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents?.total_volume)) + if(istype(I, /obj/item/storage/fancy/vials/random) && !length(I.contents)) + break + if(istype(I, /obj/item/reagent_container/glass/beaker/vial/random) && !I.reagents?.total_volume) break detected = TRUE