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

Invalidoperation: Nesting more than one spritebatch.begin when using SpriteSortMode.Immediate is not allowed. #634

Closed mklingen closed 6 years ago

mklingen commented 6 years ago

https://sentry.io/cfg/dwarfcorp/issues/509589040/

InvalidOperationException: Nesting more than one SpriteBatch.Begin when using a SpriteBatch with SpriteSortMode.Immediate is not allowed.
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\DwarfGame.cs", line 413, in SafeSpriteBatchBegin
    Void SafeSpriteBatchBegin(Microsoft.Xna.Framework.Graphics.SpriteSortMode, Microsoft.Xna.Framework.Graphics.BlendState, Microsoft.Xna.Framework.Graphics.SamplerState, Microsoft.Xna.Framework.Graphics.DepthStencilState, Microsoft.Xna.Framework.Graphics.R...
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Graphics\Animation\Composite.cs", line 98, in RenderToTarget
    Void RenderToTarget(Microsoft.Xna.Framework.Graphics.GraphicsDevice)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Graphics\Animation\CompositeLibrary.cs", line 49, in Render
    Void Render(Microsoft.Xna.Framework.Graphics.GraphicsDevice)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\World\WorldManager.cs", line 758, in Render
    Void Render(DwarfCorp.DwarfTime)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\GameStates\PlayState.cs", line 400, in Render
    Void Render(DwarfCorp.DwarfTime)
...
(3 additional frame(s) were not displayed)

Nesting more than one SpriteBatch.Begin when using a SpriteBatch with SpriteSortMode.Immediate is not allowed.
mklingen commented 6 years ago

Was missing a try/finally here, which means we're dealing with a crash elsewhere in the program.