MiniB3D

BlitzMax Modules Forums/MiniB3D/MiniB3D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hey All, This weekend i put together a simple shooter and ran into a strange problem in MiniB3D.

Very intermittently ( perhaps 1 in 100 times) when calling FreeEntity, the game would crash while attempting to access a null object.

I narrowed this down to the line that uses the link to remove the entity from the list of all entities. I fixed the crash by removing the object from the list rather than using the link.

For example, this works
TEntity.entity_list.Remove (Self.Mesh)

but this creates the intermittent crash
Self.Mesh.Link.Remove()

Does anybody know the difference between the two?

It is possible that I'm calling this twice on an object, would Link.Remove crash but List.Remove work if the object was already removed from the list?