ソースを参照

fix chunk naighbour indizes

Kolja Strohm 3 年 前
コミット
b8d735ceaf
2 ファイル変更2 行追加1 行削除
  1. 1 0
      FactoryCraft/Area.cpp
  2. 1 1
      FactoryCraft/Chunk.cpp

+ 1 - 0
FactoryCraft/Area.cpp

@@ -71,5 +71,6 @@ int getDirectionIndex( Direction dir )
         return 4;
     if( dir == BOTTOM )
         return 5;
+    assert( false );
     return -1;
 }

+ 1 - 1
FactoryCraft/Chunk.cpp

@@ -105,7 +105,7 @@ void Chunk::putBlockAt( Framework::Vec3<int> location, Block *block )
 
 void Chunk::setNeighbor( Direction dir, Chunk *zChunk )
 {
-    zNeighbours[ dir ] = zChunk;
+    zNeighbours[ getDirectionIndex(dir) ] = zChunk;
     for( int i = 0; i < CHUNK_SIZE; i++ )
     {
         for( int z = 0; z < WORLD_HEIGHT; z++ )