do

local CBFP_oldCollisionBeam = CollisionBeam
CollisionBeam = Class(CBFP_oldCollisionBeam) {

    DoDamage = function(self, instigator, damageData, targetEntity)

        # Added by Brute51: The function passes the point of impact via self:GetPosition(1). The 1 here means the
        # end of the beam. If you inspect the original script you'll find that on line 86 that is missing the 1. The
        # code below overwrites that specific line, hence the rather complex IF statement. Fixes weird shield
        # animations with beam weapons [166]

        # copied from original script
        local radius = damageData.DamageRadius or 0
        local damage = damageData.DamageAmount or 0
        local dmgmod = 1
        if self.Weapon.DamageModifiers then
            for k, v in self.Weapon.DamageModifiers do
                dmgmod = v * dmgmod
            end
        end
        damage = damage * dmgmod

        if (instigator and damage > 0) and not (radius and radius > 0) and targetEntity and (not damageData.DoTTime or damageData.DoTTime <= 0) then
            Damage(instigator, self:GetPosition(1), targetEntity, damage, damageData.DamageType)
            # this fix is all about...          ^  that character!
        else
            CBFP_oldCollisionBeam.DoDamage(self, instigator, damageData, targetEntity)
        end
    end,
}


end