Maybe a small change to make the code more readable:

bool foundShortcut = false;
if (tryLOS) {
   rayHit.t = 0;
   raycast(...);
   foundShortcut = rayHit.t >= 1.0f;
}

if (foundShortcut)
{
   // Shortcut found using, use the shorter cost instead.
   cost = parentNode->cost + rayHit.pathCost;
}
else
{
   // No shortcut
    ...
}
...
neighbourNode->pidx = foundShortcut ? m_nodePool->getNodeIdx(bestNode) : bestNode->pidx;