Adds Z checking to CanDamage function.