Project

General

Profile

« Previous | Next » 

Revision 7c1a110c

Added by Leszek Koltunski over 1 year ago

Generic tablebase solver: prevent endless loops.

View differences:

src/main/java/org/distorted/objectlib/tablebases/TablebasesCreator.java
301 301

  
302 302
    while(index!=0)
303 303
      {
304
      boolean found = false;
305

  
304 306
      for(int ax=0; ax<mNumAxis; ax++)
305 307
        {
306 308
        int numLayers = mNumLayers[ax];
......
343 345
              ax=mNumAxis;
344 346
              index = childIndex;
345 347
              level = (level==0 ? 2 : (byte)(level-1));
348
              found = true;
346 349
              }
347 350
            }
348 351
          }
......
352 355

  
353 356
      quatBasis = 0;
354 357
      quats = getQuats(index);
358

  
359
      if( !found )
360
        {
361
        // error, no move found which would move us closer to a solution
362
        return null;
363
        }
355 364
      }
356 365

  
357 366
    return convertMoves(moves);

Also available in: Unified diff