Still dealing with a very strange issue (Mind fixing it, Kacperks?)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define MAPBLOCK_H
|
||||
#include "Base.h"
|
||||
#include <math.h>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +19,10 @@ class MapBlock
|
||||
|
||||
}
|
||||
|
||||
int getNodeAt(int x, int y, int z) // Deprecated; only used internally.
|
||||
{
|
||||
return x < 16 && z < 16 && x >= 0 && z >= 0 ? mapBlock[256 * y + z * 16 + x] : 0;
|
||||
}
|
||||
|
||||
void addNode(int id, int meta, int x, int y, int z)
|
||||
{
|
||||
@@ -58,15 +63,18 @@ class BlockManager
|
||||
{
|
||||
//if(x < 16 && x >= 0 && z < 16 && z >= 0)
|
||||
//{
|
||||
if(x < 0 || z < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Position2D block = BlockUtilities::getBlockFromNodeCoordinates(x, z);
|
||||
return mapBlocks[block.x][block.z].mapBlock[256 * y + z * 16 + x];
|
||||
|
||||
|
||||
// else
|
||||
// {
|
||||
//return mapBlocks[BlockUtilities::getBlockFromNodeCoordinates(x, z).x][BlockUtilities::getBlockFromNodeCoordinates(x, z).z];
|
||||
//return 0;
|
||||
//}
|
||||
//printf("\n\nold x: %i, old z: %i", x, z);
|
||||
//int localX = x - block.x * 16;
|
||||
//int localZ = z - block.z * 16;
|
||||
//printf("\nnew x: %i, new z: %i", x, z);
|
||||
//return mapBlocks[block.x][block.z].mapBlock[256 * y + localZ * 16 + localX];
|
||||
return mapBlocks[block.x][block.z].getNodeAt(x, y, z);
|
||||
}
|
||||
|
||||
bool isAir(int x, int y, int z)
|
||||
|
||||
Reference in New Issue
Block a user