Fixed damage registering and added it for ranged units.