Combat AI: Don't attempt to cast spells when impossible to succeed (Fixes #2059)