Bonus points if you can add a target visibility check there too, as proposed in #3659.