- if (sp->nodeType == Root)
- search<SplitPointRoot>(pos, ss+1, sp->alpha, sp->beta, sp->depth);
- else if (sp->nodeType == PV)
- search<SplitPointPV>(pos, ss+1, sp->alpha, sp->beta, sp->depth);
- else if (sp->nodeType == NonPV)
- search<SplitPointNonPV>(pos, ss+1, sp->alpha, sp->beta, sp->depth);
- else
- assert(false);
+ try {
+ switch (sp->nodeType) {
+ case Root:
+ search<SplitPointRoot>(pos, ss, sp->alpha, sp->beta, sp->depth, sp->cutNode);
+ break;
+ case PV:
+ search<SplitPointPV>(pos, ss, sp->alpha, sp->beta, sp->depth, sp->cutNode);
+ break;
+ case NonPV:
+ search<SplitPointNonPV>(pos, ss, sp->alpha, sp->beta, sp->depth, sp->cutNode);
+ break;
+ default:
+ assert(false);
+ }