diff options
Diffstat (limited to 'source/blender/blenkernel/intern/fluid.c')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index ae51c997a08..310410d8e0f 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -770,7 +770,9 @@ static void bb_combineMaps(FluidObjectBB *output, /* Values. */ output->numobjs[index_out] = bb1.numobjs[index_in]; - output->influence[index_out] = bb1.influence[index_in]; + if (output->influence && bb1.influence) { + output->influence[index_out] = bb1.influence[index_in]; + } output->distances[index_out] = bb1.distances[index_in]; if (output->velocity && bb1.velocity) { copy_v3_v3(&output->velocity[index_out * 3], &bb1.velocity[index_in * 3]); @@ -785,12 +787,14 @@ static void bb_combineMaps(FluidObjectBB *output, /* Values. */ output->numobjs[index_out] = MAX2(bb2->numobjs[index_in], output->numobjs[index_out]); - if (additive) { - output->influence[index_out] += bb2->influence[index_in] * sample_size; - } - else { - output->influence[index_out] = MAX2(bb2->influence[index_in], - output->influence[index_out]); + if (output->influence && bb2->influence) { + if (additive) { + output->influence[index_out] += bb2->influence[index_in] * sample_size; + } + else { + output->influence[index_out] = MAX2(bb2->influence[index_in], + output->influence[index_out]); + } } output->distances[index_out] = MIN2(bb2->distances[index_in], output->distances[index_out]); |