From c84b371d629ebf7df1ec0fafe10528d98a612f7c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Thu, 4 Nov 2021 22:18:44 +0100
Subject: [PATCH] Assign the correct depth to the newly born stars

---
 src/cell_convert_part.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cell_convert_part.c b/src/cell_convert_part.c
index 41c2c6145e..86389d3633 100644
--- a/src/cell_convert_part.c
+++ b/src/cell_convert_part.c
@@ -268,6 +268,9 @@ struct spart *cell_add_spart(struct engine *e, struct cell *const c) {
   const size_t one = 1;
   atomic_sub(&e->s->nr_extra_sparts, one);
 
+  /* Give the new particle the correct depth */
+  cell_set_spart_h_depth(sp, c);
+
   return sp;
 }
 
-- 
GitLab