Closed stefan2200 closed 3 years ago
Looks good to me.
I'm actually quite ashamed that I didn't find the time to get to the bottom of all the bugs, since I am still figuring out some personal stuff.
Thank you for this. I'll test this and merge it into the master branch.
Thanks for the quick reply!
Hopefully this merge fixes the issue because NCS is one of those essential late-game mods.
But I'm still trying to figure out what caused the issue in the first place, it looks like the Parallel did not seem to like the remove
list since m_particles contained over 60.000 entries after 40 minutes of playing.
That is why I also implemented if (item != null) item.Unload(); if (m_particles != null && m_particles.Contains(item)) m_particles.Remove(item);
since Remove removes the instance of item and not the value (null).
If I find the time I might look into some of the other open issues, especially #147 since that one starts to annoy me :)
Good luck testing!
Yeah, it is absolutely possible that the sheer amount of entries lagged the main-thread into oblivion. Doing it with Parallel.ForEach like this seems like a better way.
I also just found out that I cannot really test this myself, since I permanently moved to Linux (Windows sucks) and I can't get it to work here. The only thing I can do is just code in Rider.
Hmmm perhaps any other maintainers can take a look sometime, my NCS dev is working again so no hurry :)
thanks Stefan, I've checked the merge out and I have not been experiencing the save bug, I also don't have a world where that was happening, so if someone has a world with that problem, I can try it out.
Might require some further testing but it worked for over 30 minutes on projection, construction, deconstruction and life support without any issues. This merge should fix #160 and #113