Fix syntax error

Fix: trivial syntax error that prevented building.
Change: refactor and regroup IsAttacked code to be clearer.