1
0

Simplefied GetPyramidLevel

This commit is contained in:
STRWarrior 2014-04-12 00:13:16 +02:00
parent 875c2557c3
commit e19556ebf6

View File

@ -35,25 +35,17 @@ int cBeaconEntity::GetPyramidLevel()
for (int Y = Area.GetSizeY() - 1; Y > 0; Y--) for (int Y = Area.GetSizeY() - 1; Y > 0; Y--)
{ {
bool FullLayer = true;
for (int X = MiddleXZ - Layer; X <= (MiddleXZ + Layer); X++) for (int X = MiddleXZ - Layer; X <= (MiddleXZ + Layer); X++)
{ {
for (int Z = MiddleXZ - Layer; Z <= (MiddleXZ + Layer); Z++) for (int Z = MiddleXZ - Layer; Z <= (MiddleXZ + Layer); Z++)
{ {
if (!IsMineralBlock(Area.GetRelBlockType(X, Y, Z))) if (!IsMineralBlock(Area.GetRelBlockType(X, Y, Z)))
{ {
FullLayer = false; return Layer;
} }
} }
} }
if (!FullLayer) Layer++;
{
break;
}
else
{
Layer++;
}
} }
return Layer; return Layer;
@ -84,6 +76,7 @@ bool cBeaconEntity::IsMineralBlock(BLOCKTYPE a_BlockType)
bool cBeaconEntity::Tick(float a_Dt, cChunk & a_Chunk) bool cBeaconEntity::Tick(float a_Dt, cChunk & a_Chunk)
{ {
std::cout << GetPyramidLevel() << "\n";
return false; return false;
} }