The particle's index was being stored in it's type data before being
sorted to preserve the order. But the particle's type data is changed,
leading to the incorrect order when sorting for the original order.
This has been fixed by creating another array to store the index.
The particle's index was being stored in it's type data before being sorted to preserve the order. But the particle's type data is changed, leading to the incorrect order when sorting for the original order.
This has been fixed by creating another array to store the index.