Skip to content

Commit 00d84b5

Browse files
Expanding disposal pipe UT failure info.
1 parent 970b5e5 commit 00d84b5

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

code/datums/trading/traders/ai.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ They sell generic supplies and ask for generic supplies.
4949
/obj/item/box/fancy = TRADER_SUBTYPES_ONLY,
5050
/obj/item/laundry_basket = TRADER_THIS_TYPE,
5151
/obj/item/secure_storage/briefcase = TRADER_THIS_TYPE,
52-
/obj/item/plant_satchel = TRADER_THIS_TYPE,
52+
/obj/item/plant_satchel = TRADER_THIS_TYPE,
5353
/obj/item/ore_satchel = TRADER_THIS_TYPE,
5454
/obj/item/toolbox = TRADER_ALL,
5555
/obj/item/wallet = TRADER_THIS_TYPE,

code/modules/recycling/disposalpipe.dm

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,21 @@
592592

593593
dpdir = sortdir | posdir | negdir
594594

595-
/obj/structure/disposalpipe/sortjunction/Initialize()
595+
/obj/structure/disposalpipe/sortjunction/proc/validate_sort_type()
596+
. = istext(sort_type) && sort_type != ""
597+
if(!.)
598+
if(name == initial(name))
599+
sort_type = "Unknown"
600+
else
601+
sort_type = name || "Unknown"
602+
log_debug("Mapped untagged junction had empty sort_type, setting to '[sort_type]'.")
603+
604+
/obj/structure/disposalpipe/sortjunction/Initialize(ml)
596605
. = ..()
597-
if(sort_type) global.tagger_locations |= sort_type
606+
if(sort_type)
607+
global.tagger_locations |= sort_type
608+
if(ml && !validate_sort_type())
609+
log_warning("Mapped sorting junction of type [type] initializing at [x],[y],[z] with invalid sort_type '[sort_type || "EMPTY"]'!")
598610

599611
updatedir()
600612
updatename()
@@ -662,6 +674,9 @@
662674
desc = "An underfloor disposal pipe which filters all wrapped and tagged items."
663675
flipped_state = /obj/structure/disposalpipe/sortjunction/wildcard/flipped
664676

677+
/obj/structure/disposalpipe/sortjunction/wildcard/validate_sort_type()
678+
return TRUE // Special case
679+
665680
/obj/structure/disposalpipe/sortjunction/wildcard/divert_check(var/checkTag)
666681
return checkTag != ""
667682

@@ -671,6 +686,12 @@
671686
desc = "An underfloor disposal pipe which filters all untagged items."
672687
flipped_state = /obj/structure/disposalpipe/sortjunction/untagged/flipped
673688

689+
/obj/structure/disposalpipe/sortjunction/untagged/validate_sort_type()
690+
. = (sort_type == "")
691+
if(!.)
692+
log_debug("Mapped untagged junction had non-empty sort_type, setting to empty string.")
693+
sort_type = ""
694+
674695
/obj/structure/disposalpipe/sortjunction/untagged/divert_check(var/checkTag)
675696
return checkTag == ""
676697

code/unit_tests/map_tests.dm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,15 @@ var/global/_unit_test_sort_junctions = list()
818818
package.test = src
819819
packages_awaiting_delivery[package] = start_tag
820820

821+
/datum/unit_test/networked_disposals_shall_deliver_tagged_packages/fail(message)
822+
. = ..()
823+
if(length(packages_awaiting_delivery))
824+
log_unit_test("[ascii_red]!!! FAILURE !!! [length(packages_awaiting_delivery)] package\s still processing.")
825+
for(var/obj/structure/disposalholder/unit_test/package in packages_awaiting_delivery)
826+
var/turf/package_turf = get_turf(package)
827+
log_unit_test("[ascii_red] - [packages_awaiting_delivery[package]]: [package_turf?.x || "NULL"],[package_turf?.y || "NULL"],[package_turf?.z || "NULL"]")
828+
packages_awaiting_delivery.Cut()
829+
821830
/obj/structure/disposalholder/unit_test
822831
is_spawnable_type = FALSE // NO
823832
var/datum/unit_test/networked_disposals_shall_deliver_tagged_packages/test

0 commit comments

Comments
 (0)