The doctrine of proximate cause determines: