Skip to content

Commit e42150f

Browse files
authored
chem rounding return values are more accurate (#1229)
1 parent 2561011 commit e42150f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

code/modules/reagents/chemistry/holder.dm

+5-2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@
124124
handle_reactions()
125125
return amount
126126

127+
if(!is_reacting && amount < CHEMICAL_VOLUME_ROUNDING)
128+
return 0
129+
127130
//otherwise make a new one
128131
var/datum/reagent/new_reagent = new reagent(data)
129132
cached_reagents += new_reagent
@@ -146,7 +149,7 @@
146149
SEND_SIGNAL(src, COMSIG_REAGENTS_NEW_REAGENT, new_reagent, amount, reagtemp, data, no_react)
147150
if(!no_react)
148151
handle_reactions()
149-
return TRUE
152+
return amount
150153

151154
/**
152155
* Removes a specific reagent. can supress reactions if needed
@@ -232,7 +235,7 @@
232235
total_removed_amount += remove_reagent(reagent.type, reagent.volume * part)
233236
handle_reactions()
234237

235-
return round(total_removed_amount, CHEMICAL_VOLUME_ROUNDING)
238+
return round(total_removed_amount, CHEMICAL_QUANTISATION_LEVEL)
236239

237240
/**
238241
* Removes an specific reagent from this holder

0 commit comments

Comments
 (0)