Error when running terraria (trainer related)
wsensor opened this issue · 1 comments
When running terraria api if I use the middle click when not actually on a "world file" or when I am not clicking on the terraria process window.
System.NullReferenceException: Object reference not set to an instance of an object.
at TrainerPlugin.TrainerHelper.DestroyTile(int32 x, int32 y)
at TrainerPlugin.TrainerHelper.DestroyTileFromCursor(Boolean isWall, Boolean isBigBrush)
at TrainerPlugin.TrainerPlugin.TerrariaHooks_Update(GameTime gameTime)
at Systen,Action`1.Invoke(T obj)
next line is pointing to the directory I compiled terrariaapi into
at TerrariaApi.Hooks.GameHooks.OnUpdate(Boolean pre, GameTime time) in c:\terrariaapi\terrar\TerrariaApi\Hooks\GameHooks.cs:line 28
previos line is pointing to the directory I compiled terrariaapi into
at Terraria.Main.Update(GameTime gameTime)
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.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.Main(String[] args)
This error leaves the game in memory and technically crashes terraria while leaving the process running.
I also noticed an issue when teleporting or moving too fast about tile drawing errors but have not reproduced it often seems to be when tiles are not loaded yet or something.
I will post on the 2nd issue if and when it happens again.
It is fixed in last commit.