Blecki / dwarfcorp

An open-source 3D colony management game for PC, Mac and Linux
http://www.dwarfcorp.com
Other
580 stars 71 forks source link

Null reference while updating sunlight. #1028

Open mklingen opened 5 years ago

mklingen commented 5 years ago

So, after looking at breadcrumbs from the other crashes we still have, what I'm seeing is a really weird phenomenon where the player enters a new game state, but then somehow returns to the Intro state. Upon returning to the intro state, (or perhaps before?) the asset manager complains that all the textures in the game basically have been unloaded -- a sign that the graphics device has died. Since loading happens in a thread it's hard to disentangle what's happening in the load thread vs. what the player is doing in this situation.

https://sentry.io/organizations/cfg/issues/871046102/?project=192119&referrer=github_plugin

NullReferenceException: Object reference not set to an instance of an object.
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Voxels\ChunkGenerator.cs", line 731, in UpdateSunlight
    Void UpdateSunlight(DwarfCorp.VoxelChunk)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Voxels\ChunkManager.cs", line 298, in GenerateInitialChunks
    Void GenerateInitialChunks(Microsoft.Xna.Framework.Rectangle, DwarfCorp.GlobalChunkCoordinate, System.Action`1[System.String])
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\World\WorldManager-Loading.cs", line 417, in LoadThreaded
    Void LoadThreaded()

Object reference not set to an instance of an object.
mklingen commented 5 years ago

I've put in a failsafe that should prevent the underlying issue. Will need to more data to understand if it's still happening and why.