@@ -100,7 +100,7 @@ SUBSYSTEM_DEF(fluids)
100100 i++
101101 current_fluid_holder = processing_fluids[i]
102102
103- if (QDELETED (current_fluid_holder) || ! current_fluid_holder. reagents?. total_volume )
103+ if (QDELETED (current_fluid_holder) || ! REAGENT_TOTAL_VOLUME ( current_fluid_holder. reagents) )
104104 REMOVE_ACTIVE_FLUID (current_fluid_holder)
105105 continue
106106
@@ -110,7 +110,7 @@ SUBSYSTEM_DEF(fluids)
110110
111111 reagent_holder = current_fluid_holder. reagents
112112 UPDATE_FLUID_BLOCKED_DIRS (current_fluid_holder)
113- current_depth = reagent_holder?. total_volume || 0
113+ current_depth = REAGENT_TOTAL_VOLUME ( reagent_holder)
114114
115115 // How is this happening
116116 if (QDELETED (reagent_holder) || current_depth == - 1 . #IND || current_depth == 1 . #IND )
@@ -123,7 +123,7 @@ SUBSYSTEM_DEF(fluids)
123123 current_depth = current_fluid_holder. get_fluid_depth()
124124
125125 // Mimimum liquid depth for creation of slurries. Do this after evaporation since it may change the total depth.
126- if (reagent_holder?. total_liquid_volume < FLUID_SLURRY )
126+ if (REAGENT_TOTAL_LIQUID_VOLUME ( reagent_holder) < FLUID_SLURRY )
127127 current_fluid_holder. dump_solid_reagents()
128128 current_depth = current_fluid_holder. get_fluid_depth()
129129
@@ -135,7 +135,7 @@ SUBSYSTEM_DEF(fluids)
135135 // Wash our turf.
136136 current_fluid_holder. fluid_act(reagent_holder)
137137
138- if (isspaceturf(current_fluid_holder) || (istype(current_fluid_holder, / turf / floor) && (current_fluid_holder. turf_flags & TURF_FLAG_ABSORB_LIQUID ) && (current_fluid_holder. reagents?. total_volume + current_fluid_holder. get_physical_height()) > 0 ))
138+ if (isspaceturf(current_fluid_holder) || (istype(current_fluid_holder, / turf / floor) && (current_fluid_holder. turf_flags & TURF_FLAG_ABSORB_LIQUID ) && (REAGENT_TOTAL_VOLUME ( current_fluid_holder. reagents) + current_fluid_holder. get_physical_height()) > 0 ))
139139 removing = round(current_depth * 0.5 )
140140 if (removing > 0 )
141141 current_fluid_holder. remove_fluids(removing, defer_update = TRUE )
@@ -154,8 +154,9 @@ SUBSYSTEM_DEF(fluids)
154154 if (other_fluid_holder)
155155 UPDATE_FLUID_BLOCKED_DIRS (other_fluid_holder)
156156 if (! (other_fluid_holder. fluid_blocked_dirs & UP ) && other_fluid_holder. CanFluidPass(UP ))
157- if (! QDELETED (other_fluid_holder) && other_fluid_holder. reagents?. total_volume < FLUID_MAX_DEPTH )
158- current_fluid_holder. transfer_fluids_to(other_fluid_holder, min(floor(current_depth* 0.5 ), FLUID_MAX_DEPTH - other_fluid_holder. reagents?. total_volume))
157+ var /other_volume = REAGENT_TOTAL_VOLUME (other_fluid_holder. reagents)
158+ if (! QDELETED (other_fluid_holder) && other_volume < FLUID_MAX_DEPTH )
159+ current_fluid_holder. transfer_fluids_to(other_fluid_holder, min(floor(current_depth* 0.5 ), FLUID_MAX_DEPTH - other_volume))
159160 current_depth = current_fluid_holder. get_fluid_depth()
160161
161162 // Flow into the lowest level neighbor.
@@ -173,7 +174,7 @@ SUBSYSTEM_DEF(fluids)
173174 if ((neighbor. fluid_blocked_dirs & coming_from) || ! neighbor. CanFluidPass(coming_from) || neighbor. is_flooded(absolute = TRUE ) || ! neighbor. CanFluidPass(global . reverse_dir[spread_dir]))
174175 continue
175176 other_fluid_holder = neighbor
176- neighbor_depth = (other_fluid_holder? . reagents?. total_volume || 0 ) + neighbor. get_physical_height()
177+ neighbor_depth = (REAGENT_TOTAL_VOLUME ( other_fluid_holder. reagents) ) + neighbor. get_physical_height()
177178 flow_amount = round((current_turf_depth - neighbor_depth)* 0.5 )
178179 // TODO: multiply flow amount or minimum transfer amount by some
179180 // viscosity calculation to allow for piles of jelly vs piles of water.
@@ -235,7 +236,7 @@ SUBSYSTEM_DEF(fluids)
235236 if (current_fluid_holder. last_flow_strength >= 10 )
236237 // Catwalks mean items will be above the turf; subtract the turf height from our volume.
237238 // TODO: somehow handle stuff that is on a catwalk or on the turf within the same turf.
238- var /effective_volume = current_fluid_holder. reagents?. total_volume
239+ var /effective_volume = REAGENT_TOTAL_VOLUME ( current_fluid_holder. reagents)
239240 if (current_fluid_holder. get_supporting_platform())
240241 // Depth is negative height, hence +=. TODO: positive heights? No idea how to handle that.
241242 effective_volume += current_fluid_holder. get_physical_height()
0 commit comments