Fixed trajectory calculation when AI is playing