This project has moved. For the latest updates, please go here.

Odd bug encountered

Topics: Developer Forum, User Forum
Dec 4, 2010 at 5:00 AM

Hey during development of my game a very rare bug has occured 4 times over the last few days...

Basicly FixtureB and FixtureA are both null when they shouldn't be and they are inside a if null check so it should be impossible...

//Reverse the order of the reported fixtures. The first fixture is always the one
//that the
user subscribed to.
if (FixtureA != null && FixtureB != null)
                   if (FixtureA.OnCollision != null)
                       Enabled = FixtureA.OnCollision(FixtureA, FixtureB, this);
                   if (FixtureB.OnCollision != null)
                       Enabled = FixtureB.OnCollision(FixtureB, FixtureA, this); //This line here throws the null exeception because FixtureB and FixtureA are both null...

at FarseerPhysics.Dynamics.Contacts.Contact.Update(ContactManager contactManager)
   at FarseerPhysics.Dynamics.World.SolveTOI(TimeStep& step)
   at FarseerPhysics.Dynamics.World.Step(Single dt)
   at HAZZAH_ENGINE.MANAGERS.g_EntityManager.Update(GameTime in_GameTime)
   at Dice_Roller_3D.Main.Update(GameTime in_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.MobileGameHost.RunOneFrame()
   at Microsoft.Xna.Framework.MobileGameHost.gameLoopTimer_Tick(Object sender, EventArgs e)
   at Microsoft.Xna.Framework.DispatcherTimerWin32.TimerElapsed(IntPtr hWnd, UInt32 uMsg, IntPtr nIDEvent, UInt32 uTime)

Any idea how I can fix this?