Function to update ships array.