Project

General

Profile

« Previous | Next » 

Revision 927484cb

Added by Leszek Koltunski 7 months ago

Fix scrambling of shapeshifting cuboids.

View differences:

src/main/java/org/distorted/objectlib/scrambling/ObjectScrambler.java
639 639

  
640 640
    int xCoreL=-1, xCoreR=-1, yCoreL=-1, yCoreR=-1, zCoreL=-1, zCoreR=-1;
641 641

  
642
    if( ((x+y+z)%2)==0 )
642
    boolean moduloXY = ( (x-y)%2 == 0 );
643
    boolean moduloXZ = ( (x-z)%2 == 0 );
644
    boolean moduloYZ = ( (y-z)%2 == 0 );
645

  
646
    if( moduloXY && moduloXZ && moduloYZ )
643 647
      {
644 648
      int m = x<y ? Math.min(x,z) : Math.min(y,z);
645 649

  
......
652 656
      }
653 657
    else
654 658
      {
655
      if( ((x-y)%2) != 0 && ((x-z)%2) != 0 )
659
      if( !moduloXY && !moduloXZ )
656 660
        {
657 661
        int m = Math.min(y,z);
658 662

  
......
663 667
        zCoreL = (z-m)/2;
664 668
        zCoreR = (z+m)/2 -1;
665 669
        }
666
      else if( ((y-x)%2) != 0 && ((y-z)%2) != 0 )
670
      else if( !moduloXY && !moduloYZ )
667 671
        {
668 672
        int m = Math.min(x,z);
669 673

  
......
674 678
        zCoreL = (z-m)/2;
675 679
        zCoreR = (z+m)/2 -1;
676 680
        }
677
      else if( ((z-x)%2) != 0 && ((z-y)%2) != 0 )
681
      else if( !moduloXZ && !moduloYZ )
678 682
        {
679 683
        int m = Math.min(x,y);
680 684

  
......
687 691
        }
688 692
      }
689 693

  
690
    android.util.Log.e("D", " xl="+xCoreL+" xr="+xCoreR+" yl="+yCoreL+" yr="+yCoreR+" zl="+zCoreL+" zr="+zCoreR);
691

  
692

  
693 694
    xCoreL = (1<<xCoreL);
694 695
    xCoreR = (1<<xCoreR);
695 696
    yCoreL = (1<<yCoreL);

Also available in: Unified diff