Files
Ghom 5139e4efde unblacklists botany fruits and vegetables from unit tests. (#89683)
## About The Pull Request
subtypes of `/obj/item/food/grown` have no reason to not be spawned by
the `create_and_destroy` unit test, which prevents us from knowing if a
type fruit or veggie doesn't have a set seed in the tests. The only path
that needs to be blacklisted is the common `/obj/item/food/grown` path
itself, since its seed variable needs to remain null so that we can be
warned about any subtype that hasn't overriden that value.
This PR also removes the `/obj/item/food/grown/shell` path which serves
no purpose anymore.

## Why It's Good For The Game
Backend improvements. Atomizing changes from my refactor.

## Changelog
N/A
2025-03-12 17:11:03 -04:00

24 lines
734 B
Plaintext

/// Makes sure that spawned food has reagents and the edible component (or else it can't be eaten).
/datum/unit_test/food_edibility_check
/datum/unit_test/food_edibility_check/Run()
var/list/not_food = list(
/obj/item/food/grown,
/obj/item/food/grown/mushroom,
/obj/item/food/clothing,
/obj/item/food/meat/slab/human/mutant,
)
var/list/food_paths = subtypesof(/obj/item/food) - not_food
for(var/food_path in food_paths)
var/obj/item/food/spawned_food = allocate(food_path)
if(!spawned_food.reagents)
TEST_FAIL("[food_path] does not have any reagents, making it inedible!")
if(!IS_EDIBLE(spawned_food))
TEST_FAIL("[food_path] does not have the edible component, making it inedible!")
qdel(spawned_food)