Fix broken AI for creatures with OnTarget spells (Bug #1927)