Parchment crash fix (attempt)
Reported by Pleb Crusher, I'm unable to reproduce this issue myself.
Here is his crash log: keeperfx.log
I had this crash sometimes before 1.0 and haven't found a way to reproduce it either. My observations at the time were that this happened if I click-spam while the cursor is not yet displayed (so shortly after loading).
I had this crash sometimes before 1.0 and haven't found a way to reproduce it either. My observations at the time were that this happened if I click-spam while the cursor is not yet displayed (so shortly after loading).
Reproduce by disabling splash screens and heart zoom and press M on a level with rooms asap. Or have the cursor top left and click to open the map.
I have investigated and it crashed because the render_ghost is initialized when the level is drawn. With the skip heart zoom option it is possible to go to the map before display_drawlist is called, and thus render_ghost is not initialized before entering the map.
The render_ghost is then used while drawing resized sprites on the parchment map, crashing the game. I updated the fix to initialize the variables on the map too in case they are uninitialized.