mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Merges copy_to() into trans_to() for reagent holder (#92410)
## About The Pull Request Merges `/datum/reagents/proc/copy_to()` -> `/datum/reagents/proc/trans_to()`. Added a parameter `copy_only` to indicate we want a copy operation ## Why It's Good For The Game - Less code to maintain - All the functionality of `trans_to()`[logging, transferring single reagent, expelling reagents from stomach, etc] now applies for copying reagents as well which was missing a lot of it, so we have consistent behaviour ## Changelog 🆑 refactor: code for copying reagents has been refactored. Please report bugs on github /🆑
This commit is contained in:
@@ -918,7 +918,7 @@
|
||||
if(!bottle)
|
||||
return ..()
|
||||
icon_state = bottle.icon_state
|
||||
bottle.reagents.copy_to(src, 100)
|
||||
bottle.reagents.trans_to(src, 100, copy_only = TRUE)
|
||||
if(istype(bottle, /obj/item/reagent_containers/cup/glass/bottle/juice))
|
||||
desc += " You're not sure if making this out of a carton was the brightest idea."
|
||||
isGlass = FALSE
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
trans = reagents.trans_to(affected_mob, amount_per_transfer_from_this, transferred_by = user, methods = INJECT)
|
||||
else
|
||||
reagents.expose(affected_mob, INJECT, fraction)
|
||||
trans = reagents.copy_to(affected_mob, amount_per_transfer_from_this, copy_methods = INJECT)
|
||||
trans = reagents.trans_to(affected_mob, amount_per_transfer_from_this, methods = INJECT, copy_only = TRUE)
|
||||
to_chat(user, span_notice("[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src]."))
|
||||
log_combat(user, affected_mob, "injected", src, "([contained])")
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user