more aicombat pathfinding fixes

Zini, would you mind cherry picking a6f201c and 1105f6e please.