From 70bf7e6d9074cee8ff7072c2909704ff5cb65112 Mon Sep 17 00:00:00 2001 From: prodirus <44090982+prodirus@users.noreply.github.com> Date: Fri, 11 Dec 2020 07:34:30 +0000 Subject: [PATCH] Fix donuts always overriding species-level taste reaction (#55349) Fixes #55302. The donut `check_liked` callback would return null if its conditions weren't met, so the `food_taste_reaction` checks would be totally skipped over. No donuts for you, carnivore. --- code/datums/components/food/edible.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/datums/components/food/edible.dm b/code/datums/components/food/edible.dm index 5c77b3581c5..4647ce1b039 100644 --- a/code/datums/components/food/edible.dm +++ b/code/datums/components/food/edible.dm @@ -377,15 +377,16 @@ Behavior that's still missing from this component that original food items had t var/food_taste_reaction - if(check_liked) //Callback handling; use this as an override for special food like donuts food_taste_reaction = check_liked.Invoke(fraction, H) - else if(foodtypes & H.dna.species.toxic_food) - food_taste_reaction = FOOD_TOXIC - else if(foodtypes & H.dna.species.disliked_food) - food_taste_reaction = FOOD_DISLIKED - else if(foodtypes & H.dna.species.liked_food) - food_taste_reaction = FOOD_LIKED + + if(!food_taste_reaction) + if(foodtypes & H.dna.species.toxic_food) + food_taste_reaction = FOOD_TOXIC + else if(foodtypes & H.dna.species.disliked_food) + food_taste_reaction = FOOD_DISLIKED + else if(foodtypes & H.dna.species.liked_food) + food_taste_reaction = FOOD_LIKED switch(food_taste_reaction) if(FOOD_TOXIC)