private void GrabCheck(Transform collisionTransform, Rigidbody collisionRigidbody, Collider collider, ContactPoint[] contacts) { if (grabFilter != null || blockGrab > 0f || !(grabJoint == null) || !(blockGrabTrigger == null) || !(collisionTransform.tag != "NoGrab") || (targetPosition - contacts[0].point).magnitude > 0.5f) { return; } bool flag = collider.GetComponentInParent <Human>() != null; if (human.onGround && collider.tag != "Target" && !flag) { bool flag2 = collider.GetComponentInParent <Rigidbody>(); Vector3 rhs = base.transform.position - targetPosition; Vector3 normal = contacts[0].normal; float num = Vector3.Dot(normal, rhs.normalized); if (num < ((!flag2) ? 0.7f : 0.4f)) { return; } float num2 = Vector3.Dot(normal, rhs); if (num2 < ((!flag2) ? 0.2f : 0.05f)) { return; } } IGrabbable componentInParent = collisionTransform.GetComponentInParent <IGrabbable>(); if (componentInParent != null) { grabObject = (componentInParent as MonoBehaviour).gameObject; } else if (grabBody != null) { grabObject = grabBody.gameObject; } else { grabObject = collider.gameObject; } if (!CheatCodes.climbCheat && human.state == HumanState.Climb && otherSide.grabObject == grabObject) { Vector3 position = base.transform.position; float y = position.y; Vector3 position2 = otherSide.transform.position; if (y > position2.y + handToHandClimb) { return; } } grabJoint = base.gameObject.AddComponent <ConfigurableJoint>(); if ((bool)collisionRigidbody) { grabJoint.connectedBody = collisionRigidbody; } grabJoint.xMotion = ConfigurableJointMotion.Locked; grabJoint.yMotion = ConfigurableJointMotion.Locked; grabJoint.zMotion = ConfigurableJointMotion.Locked; grabJoint.angularXMotion = ConfigurableJointMotion.Locked; grabJoint.angularYMotion = ConfigurableJointMotion.Locked; grabJoint.angularZMotion = ConfigurableJointMotion.Locked; grabJoint.breakForce = 20000f; grabJoint.breakTorque = 20000f; grabJoint.enablePreprocessing = false; grabBody = collisionRigidbody; grabManager.ObjectGrabbed(grabObject); if (onGrabTap != null) { onGrabTap(base.gameObject, contacts[0].point, collider.sharedMaterial, normalTangentVelocityImpulse); } }