Skip to content

Commit

Permalink
[MIRROR] Sets reagent holder minimum volume to 0.01 (#666)
Browse files Browse the repository at this point in the history
* Sets reagent holder minimum volume to 0.01 (#81131)

## About The Pull Request
- Fixes #81096

Basically if the reagent volume inside an reagent holder falls below
`CHEMICAL_VOLUME_ROUNDING`(or 0.01) only then is it garbage collected.
Helps with small transfer rates like the plumbing iv drip

This means volumes like 0.01 of a reagent can now exist inside your
beaker, previously this was 0.05

## Changelog
:cl:
fix: sets minimum volume of reagent allowed to exist inside anything to
0.01 therefore allowing plumbing iv drip small transfer rates to occur
without reagents disappearing.
/:cl:

* Sets reagent holder minimum volume to 0.01

---------

Co-authored-by: SyncIt21 <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Jan 28, 2024
1 parent fa35254 commit a5e5ef6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry/holder/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
reagent_volume = round(reagent.volume, CHEMICAL_QUANTISATION_LEVEL) //round to this many decimal places

//remove very small amounts of reagents
if(!reagent_volume || (reagent_volume <= 0.05 && !is_reacting))
if(reagent_volume <= 0 || (!is_reacting && reagent_volume < CHEMICAL_VOLUME_ROUNDING))
//end metabolization
if(isliving(my_atom))
if(reagent.metabolizing)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/machinery/chem_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@
beaker_data["maxVolume"] = beaker.volume
beaker_data["transferAmounts"] = beaker.possible_transfer_amounts
beaker_data["pH"] = round(beaker.reagents.ph, 0.01)
beaker_data["currentVolume"] = round(beaker.reagents.total_volume, 0.01)
beaker_data["currentVolume"] = round(beaker.reagents.total_volume, CHEMICAL_VOLUME_ROUNDING)
var/list/beakerContents = list()
if(length(beaker.reagents.reagent_list))
for(var/datum/reagent/reagent in beaker.reagents.reagent_list)
beakerContents += list(list("name" = reagent.name, "volume" = round(reagent.volume, 0.01))) // list in a list because Byond merges the first list...
beakerContents += list(list("name" = reagent.name, "volume" = round(reagent.volume, CHEMICAL_VOLUME_ROUNDING))) // list in a list because Byond merges the first list...
beaker_data["contents"] = beakerContents
.["beaker"] = beaker_data

Expand Down

0 comments on commit a5e5ef6

Please sign in to comment.