Disabling items results in invalid stacks and potential crashing
Funwayguy opened this issue ยท 1 comments
While debugging a crash in Better Questing item's search I came across an interesting piece of code in PlayerStorage that appeared to be the culprit.
(similar code in other items are also at fault)
This effectively makes any attempt to lookup, render or instantiate the items impossible despite still being in the item registry. Notably, attempting to lookup any associated ore dictionary names (like BQ does for searches) results in a crash because the stack was prematurely emptied and invalidated. This could also cause major issues with machines having item data suddenly break when loading saves after such an item was disabled.
Either skip registering the item at all on startup or make the items inoperable/inaccessible (can even self delete them on attempted player use). Do not forcibly empty every instantiated item stack.
Original Issue Thread: Funwayguy/BetterQuesting#445