Skip to content

Commit 4ef6e69

Browse files
authored
Fix cleaner slimes not targeting other types of trash (#6080)
## About The Pull Request #5657 unintentionally removed the `TRAIT_TRASH_ITEM` check, which broke the ability for cleaner slimes to target things like used ammo, used mutation syringes, emptied drink bottles, burnt matches, and such. ## Why It's Good For The Game bugfix ## Changelog :cl: fix: Cleaner slimes now properly target other types of trash (used ammo, used mutation syringes, emptied drink bottles, burnt matches, etc) again. /:cl:
1 parent b4698df commit 4ef6e69

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

code/modules/mob/living/basic/bots/cleanbot/cleanbot_ai.dm

+8-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,15 @@
7272
action_cooldown = 3 SECONDS
7373

7474
/datum/ai_behavior/find_and_set/in_list/clean_targets/search_tactic(datum/ai_controller/controller, locate_paths, search_range)
75-
var/list/found = typecache_filter_list(oview(search_range, controller.pawn), locate_paths)
75+
var/list/found = oview(search_range, controller.pawn) // monkestation edit: don't pre-filter with typecache, so we can check for TRAIT_TRASH_ITEM
7676
var/list/ignore_list = controller.blackboard[BB_TEMPORARY_IGNORE_LIST]
77-
for(var/atom/found_item in found)
77+
for(var/atom/found_item as anything in found)
78+
// monkestation start: check for TRAIT_TRASH_ITEM
79+
if(QDELETED(found_item))
80+
continue
81+
if(!is_type_in_typecache(found_item, locate_paths) && !HAS_TRAIT(found_item, TRAIT_TRASH_ITEM))
82+
continue
83+
// monkestation end
7884
if(LAZYACCESS(ignore_list, REF(found_item)))
7985
continue
8086
var/list/path = get_path_to(controller.pawn, found_item, max_distance = BOT_CLEAN_PATH_LIMIT, access = controller.get_access())

monkestation/code/modules/slimecore/slime_traits/cleaner.dm

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090
is_type_in_typecache(target, cleanable_decals) \
9191
|| is_type_in_typecache(target, cleanable_blood) \
9292
|| is_type_in_typecache(target, huntable_pests) \
93-
|| is_type_in_typecache(target, huntable_trash)
93+
|| is_type_in_typecache(target, huntable_trash) \
94+
|| HAS_TRAIT(target, TRAIT_TRASH_ITEM)
9495

9596
if(target_is_dissolvable)
9697
parent.balloon_alert_to_viewers("cleaned")

0 commit comments

Comments
 (0)