1
0

Realised suggestions

This commit is contained in:
Tiger Wang 2014-03-31 21:36:19 +01:00
parent ee07b7ae3e
commit fc940b6da4
2 changed files with 12 additions and 6 deletions

View File

@ -94,7 +94,10 @@ public:
BLOCKTYPE BlockType; BLOCKTYPE BlockType;
if ( if (
((a_RelY + y < 0) || (a_RelY + y > cChunkDef::Height)) || ((a_RelY + y < 0) || (a_RelY + y > cChunkDef::Height)) ||
(!a_Chunk.UnboundedRelGetBlockType(a_RelX + x, a_RelY + y, a_RelZ + z, BlockType) || !cFireSimulator::IsFuel(BlockType)) (
!a_Chunk.UnboundedRelGetBlockType(a_RelX + x, a_RelY + y, a_RelZ + z, BlockType) ||
!cFireSimulator::IsFuel(BlockType)
)
) )
{ {
return false; return false;

View File

@ -205,7 +205,7 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
case cMonster::mtSpider: case cMonster::mtSpider:
{ {
bool CanSpawn = true; bool CanSpawn = true;
bool HaveFloor = false; bool HasFloor = false;
for (int x = 0; x < 2; ++x) for (int x = 0; x < 2; ++x)
{ {
for(int z = 0; z < 2; ++z) for(int z = 0; z < 2; ++z)
@ -216,13 +216,16 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
{ {
return false; return false;
} }
HaveFloor = ( HasFloor = (
a_Chunk->UnboundedRelGetBlockType(a_RelX + x, a_RelY - 1 /* Checked at start of function */, a_RelZ + z, TargetBlock) && HasFloor ||
(
a_Chunk->UnboundedRelGetBlockType(a_RelX + x, a_RelY - 1, a_RelZ + z, TargetBlock) &&
!cBlockInfo::IsTransparent(TargetBlock) !cBlockInfo::IsTransparent(TargetBlock)
)
); );
} }
} }
return CanSpawn && HaveFloor && (SkyLight <= 7) && (BlockLight <= 7); return CanSpawn && HasFloor && (SkyLight <= 7) && (BlockLight <= 7);
} }
case cMonster::mtCreeper: case cMonster::mtCreeper: