Nakano15
Terrarian
I've found out what caused that problem, at the end of the PostDrawInterface, I had to add spriteBatch.End(), and then the error stopped happening and the hud is being drawn as intended.Hey guys, I've found a problem.
Trying to call drawing on spritebatch at PostDrawInterface causes the game to crash showing a window with this error:
The issue surged after I updated tModLoader, and I've tried disabling the scripts in the mod that calls drawing on PostDrawInterface to see if the issue happened, and didn't, I could even play the game, when I enabled the scripts again the modloader crashes.Code:8/23/2018 4:54:15 AM System.InvalidOperationException: Begin cannot be called again until End has been successfully called. at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix) at Terraria.Main.RenderBlack() at Terraria.Main.RenderTiles() at Terraria.Main.do_Draw(GameTime gameTime) at Terraria.Main.DoDraw(GameTime gameTime) at Terraria.Main.Draw(GameTime gameTime) at Microsoft.Xna.Framework.Game.DrawFrame() at Microsoft.Xna.Framework.Game.Tick() at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e) at Microsoft.Xna.Framework.GameHost.OnIdle() at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame() at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e) at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at Microsoft.Xna.Framework.WindowsGameHost.Run() at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun) at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)
I'd like to thank the support team for all the help they provided me to fix this and other issues with this mod loader, since I know I can count on them to find the solution to a problem.
Edit:. Heh, I've noticed that the cursor disappears when you uses spriteBatch.End(), so it's either have no cursor or don't use PostDrawInterface at all.
Last edited: