mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
Refactors for grinding & juicing (#87735)
## About The Pull Request - Grinding & juicing are now recursive operations (grind the item & all its contents) not just for reagent grinder but also for mortar pedestal & plumbing grinder so you can get all them juices - Fixes #87719. Plumbing grinder won't destroy slime extracts after grinding - Mortar pedestal now grinds & juices more items since it correctly checks if that object has more reagents to offer - Reagent grinder, plumbing grinder & mortar pedestal now respect `blend_requirements()` so you get consistent behaviour across them ## Changelog 🆑 fix: mortar pedestal now grinds & juices items that previously could not be processed fix: plumbing grinder won't destroy slime extracts after grinding refactor: grinding & juicing code has been refactored overall. Please report bugs on github /🆑
This commit is contained in:
@@ -135,14 +135,10 @@
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/grind(datum/reagents/target_holder, mob/user)
|
||||
/obj/item/stack/grind_atom(datum/reagents/target_holder, mob/user)
|
||||
var/current_amount = get_amount()
|
||||
if(current_amount <= 0 || QDELETED(src)) //just to get rid of this 0 amount/deleted stack we return success
|
||||
return TRUE
|
||||
if(on_grind() == -1)
|
||||
return FALSE
|
||||
if(isnull(target_holder))
|
||||
return TRUE
|
||||
|
||||
if(reagents)
|
||||
reagents.trans_to(target_holder, reagents.total_volume, transferred_by = user)
|
||||
|
||||
Reference in New Issue
Block a user