Skip to content

Commit

Permalink
[MIRROR] Fixes some items produced by using plants not inheriting rea…
Browse files Browse the repository at this point in the history
…gent purity [MDB IGNORE] (#24486)

* Fixes some items produced by using plants not inheriting reagent purity (#79123)

## About The Pull Request

In #78322 I removed the reagent purity initialize argument from grown
items, thinking it was only used by butter. It was actually used in two
other places which I missed, in which I have implemented the same
functionality.
Rather than passing the desired purity on creation we instead just set
the purity of contents reagents after initialising the atom. This
broadly replicates what the edible component was doing, as these items
only get reagents from being edible.

## Changelog

:cl:
fix: Meatwheat Clumps, Bungo Pits, and Eggplant Eggs should once again
inherit reagent purity from the grown item which produces them.
/:cl:

* Fixes some items produced by using plants not inheriting reagent purity

---------

Co-authored-by: Jacquerel <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Oct 21, 2023
1 parent a9d96ac commit da54995
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions code/datums/elements/food/food_trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@

if(istype(source, /obj/item/food/grown) && ispath(trash, /obj/item/food))
var/obj/item/food/grown/plant = source
var/reagent_purity = plant.seed.get_reagent_purity()
trash_item = new trash(edible_object.drop_location(), reagent_purity)
trash_item = new trash(edible_object.drop_location())
trash_item.reagents?.set_all_reagents_purity(plant.seed.get_reagent_purity())
else
trash_item = generate_trash_procpath ? call(source, generate_trash_procpath)() : new trash(edible_object.drop_location())

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/food/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
)
tastes = list("caramel" = 2, "popcorn" = 1)
foodtypes = JUNKFOOD | SUGAR
trash_type = /obj/item/trash/popcorn/
trash_type = /obj/item/trash/popcorn
crafting_complexity = FOOD_COMPLEXITY_1

/obj/item/food/soydope
Expand Down
8 changes: 4 additions & 4 deletions code/modules/hydroponics/grown/cereals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
/obj/item/food/grown/meatwheat/attack_self(mob/living/user)
user.visible_message(span_notice("[user] crushes [src] into meat."), span_notice("You crush [src] into something that resembles meat."))
playsound(user, 'sound/effects/blobattack.ogg', 50, TRUE)
var/reagent_purity = seed.get_reagent_purity()
var/obj/item/food/meat/slab/meatwheat/M = new(null, reagent_purity)
var/obj/item/food/meat/slab/meatwheat/meaties = new(null)
meaties.reagents.set_all_reagents_purity(seed.get_reagent_purity())
qdel(src)
user.put_in_hands(M)
return 1
user.put_in_hands(meaties)
return TRUE

0 comments on commit da54995

Please sign in to comment.