Yeah, that's not what it does. The code looks like this:
if (pgeom->Intersect(pentlist[i]->m_parts[j].pPhysGeomProxy->pGeom, gwd,gwd+1, &ip, pcontacts)) {
got_unproj:
if (dirUnproj.len2()==0) dirUnproj = pcontacts[0].dir;
t = pcontacts[0].t; // lock should be released after reading t
return t;
}
for(int ipart=1;ipart<m_nParts;ipart++) if (m_parts[ipart].flagsCollider & pentlist[i]->m_parts[j].flags) {
gwd[2].R = Matrix33(qrot);
gwd[2].offset = pos + qrot*m_parts[ipart].pos;
gwd[2].scale = m_parts[ipart].scale;
gwd[2].v = -dirUnproj;
if (m_parts[ipart].pPhysGeomProxy->pGeom->Intersect(pentlist[i]->m_parts[j].pPhysGeomProxy->pGeom, gwd+2,gwd+1, &ip, pcontacts))
goto got_unproj;
}
}
Notice (a) the if statement on the same line as the for loop, and (b) the fact that the goto jumps out of a conditional inside a for loop inside of a conditional into a conditional just before the for loop.EDIT: Just realised the poster is referring to a different function.
IMO this one is more horrifying.