Added ranged attack handling