10.09.2012, 09:46
I think the problem is in your stock function. IsObjectInRangeOfPoint should be returning either true or false (1 or 0), probably why you're receiving the 'nothing to end...' error, because you're returning something with no proper value.