For s.ship=Each ship If s\hull=0 FreeEntity s\ship_Handle Delete s EndIf Next
Every second I call this function to delete the types of dead ships and to free their entities.
I recently re-wrote a large part of my game and there is now an error.
for s.ship=each ship moveentity s\ship_handle 0,0,s\speed next
The above function causes a (entity does not exist) error.
I used to be able to do this with no errors and I cant work out what I changed to make it go wrong.
What is the best way of using the debuglog to find out what went wrong?