From 292bf32a992cce80c838875ebbf21b814bd2214e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Thu, 6 Oct 2022 22:19:55 +0200 Subject: [PATCH] core: Track default-constructed particles When no user-defined type is available, explicitly assign type 0. This is necessary for tracking particles ids in reaction methods. --- src/script_interface/particle_data/ParticleHandle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/script_interface/particle_data/ParticleHandle.cpp b/src/script_interface/particle_data/ParticleHandle.cpp index 70b9330a93b..19e3f153230 100644 --- a/src/script_interface/particle_data/ParticleHandle.cpp +++ b/src/script_interface/particle_data/ParticleHandle.cpp @@ -483,6 +483,9 @@ void ParticleHandle::do_construct(VariantMap const ¶ms) { do_set_parameter(kv.first, kv.second); } } + if (params.count("type") == 0) { + do_set_parameter("type", 0); + } } }