mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
[MIRROR] Adds unit test for spawned food edibility (#3704)
* Adds unit test for spawned food edibility (#57232) * Adds unit test for spawned food having reagents - Adds stack trace for biting food failing due to a lack of reagents - Adds checks for seed var being set under food/grown's initialize() in grown.dm - Fixes issue with gondola meat code duplicated for penguin meat slabs resulting in a runtime and being unable to slice penguin meat - Adds seeds for bombananas Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Adds unit test for spawned food edibility Co-authored-by: cacogen <25089914+cacogen@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
This commit is contained in:
co-authored by
Mothblocks
cacogen
parent
962457da07
commit
098b4074e0
@@ -49,6 +49,7 @@
|
||||
#include "designs.dm"
|
||||
#include "dynamic_ruleset_sanity.dm"
|
||||
#include "emoting.dm"
|
||||
#include "food_edibility_check.dm"
|
||||
#include "heretic_knowledge.dm"
|
||||
#include "holidays.dm"
|
||||
#include "hydroponics_harvest.dm"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/// 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/deepfryholder,
|
||||
/obj/item/food/clothing,
|
||||
/obj/item/food/meat/slab/human/mutant,
|
||||
/obj/item/food/grown/shell)
|
||||
|
||||
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)
|
||||
Fail("[food_path] does not have any reagents, making it inedible!")
|
||||
|
||||
if(!IS_EDIBLE(spawned_food))
|
||||
Fail("[food_path] does not have the edible component, making it inedible!")
|
||||
|
||||
qdel(spawned_food)
|
||||
Reference in New Issue
Block a user