Memory Access Violation

Blitz3D Forums/Blitz3D Programming/Memory Access Violation

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.

I keep getting a Memory Access Violation with this bit of code on the ImagesCollide line. I just can't see where the problem is. Can anyone else spot it?
	;check collisions
	For thisBullet.bullettype = Each bullettype
		exitloop = False
		For thisship.shiptype = Each shiptype
			If thisship\ID = 2
				If ImagesCollide(thisbullet\image, thisbullet\bulletx, thisbullet\bullety, 0, thisship\image, thisship\shipx, thisship\shipy, 0)
					FreeImage thisBullet\image
					Delete thisBullet
					FreeImage thisship\image
					Delete thisship
					exitloop = True
				EndIf
			EndIf
			If exitloop = True Then Exit
		Next
	Next