Mannatwo / Neurotrauma

A medical overhaul mod for Barotrauma, the 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
21 stars 34 forks source link

helperfunctions Item(...) replacement fix #72

Closed OlegBSTU closed 8 months ago

OlegBSTU commented 8 months ago

replaces every single instance of Item(...) or item.Remove(...) with Entity.Spawner.AddItemToSpawnQueue(...) and Entity.Spawner.AddEntityToRemoveQueue(...)

code has been properly adapted and tested on singeplayer/multiplayer sessions by heelge(me), sadmuq, meatloaf_god on the discord server

these changes fixes the game crashing seemingly at random with throwing error: "Exception: Collection was modified; enumeration operation may not execute. (System.InvalidOperationException)"