explosion raycast

Hi,

i wrote a script for an explosion (grenade, rocket etc).
The AddExplosionForce() should not go through walls.

Most of the time the script works correctly, but sometimes the player does not get damage, even if he stands right beside the grenate.

Is there something wrong with the script?

 public static void Explode(Vector3 explosion_position, float BlastRadius, float ExplosionPower, float MaxDMG)
        {
            Collider[] hitColliders;
            hitColliders = Physics.OverlapSphere(explosion_position, BlastRadius);
            foreach (Collider hitcol in hitColliders)
            {
                if (hitcol.GetComponent<Rigidbody>() != null || hitcol.GetComponent<GaW.Player.PlayerMaster>() != null)
                {
                    //Gucken, das nix im Weg
                    RaycastHit hit;
                    bool wallhit = false;
                    if (Physics.Raycast(explosion_position, hitcol.transform.position - explosion_position, out hit, BlastRadius))
                    {
                        if (hit.transform.GetComponent<Rigidbody>() == null && hit.collider != hitcol && hit.transform.tag != "Player")
                        {
                            wallhit = true;
                        }
                    }

                    if (wallhit == false)
                    {
                        if (hitcol.GetComponent<Rigidbody>() != null)
                        {
                            hitcol.GetComponent<Rigidbody>().AddExplosionForce(ExplosionPower, explosion_position, BlastRadius, 1, ForceMode.Impulse);
                        }
                       
                        if (hitcol.GetComponent<GaW.Player.PlayerMaster>() != null)
                        {
                            Vector3 closespoint = hitcol.ClosestPoint(explosion_position);
                            float dmg = MaxDMG * (1 - (Vector3.Distance(explosion_position, closespoint) / BlastRadius));
                            hitcol.GetComponent<GaW.Player.PlayerMaster>().CallEventPlayerHealthReduction(dmg);
                        }
                    }
                }
            }
        }

Greetings

If any rays begin inside a collider, they will not detect that collider.