function RaycastWeaponBase:chk_shield_knock(hit_unit, col_ray, weapon_unit, user_unit, damage)
	if not self:can_shield_knock() or not hit_unit:in_slot(self.shield_mask) then
		return false
	end

	local enemy_unit = hit_unit:parent()
	local char_dmg_ext = alive(enemy_unit) and enemy_unit:character_damage()

	if not char_dmg_ext then
		return false
	end

	--[[changed here,char_dmg_ext.is_immune_to_shield_knockback is true
	if not char_dmg_ext.is_immune_to_shield_knockback or char_dmg_ext:is_immune_to_shield_knockback() then
		return false
	end
	--]]
	if char_dmg_ext.is_immune_to_shield_knockback then
		if char_dmg_ext:is_immune_to_shield_knockback() then
			return false
		end
	end


	local dmg_ratio = math.min(damage, self.SHIELD_MIN_KNOCK_BACK)
	dmg_ratio = dmg_ratio / self.SHIELD_MIN_KNOCK_BACK + 1
	local rand = math.random() * dmg_ratio

	if self.SHIELD_KNOCK_BACK_CHANCE < rand then
		local damage_info = {
			damage = 0,
			type = "shield_knock",
			variant = "melee",
			col_ray = col_ray,
			result = {
				variant = "melee",
				type = "shield_knock"
			}
		}

		enemy_unit:character_damage():_call_listeners(damage_info)
		return true
	end
	return false
end


