summaryrefslogtreecommitdiffstats
path: root/src/MobSpawner.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-31 22:36:19 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-31 22:36:19 +0200
commitfc940b6da4fd446e718879a19790af03dadfe2f4 (patch)
tree6e6d8f85f3067b2da3ed274b27c7683319b2067c /src/MobSpawner.cpp
parentSimplified and fixed slabs, fixes #835 (diff)
downloadcuberite-fc940b6da4fd446e718879a19790af03dadfe2f4.tar
cuberite-fc940b6da4fd446e718879a19790af03dadfe2f4.tar.gz
cuberite-fc940b6da4fd446e718879a19790af03dadfe2f4.tar.bz2
cuberite-fc940b6da4fd446e718879a19790af03dadfe2f4.tar.lz
cuberite-fc940b6da4fd446e718879a19790af03dadfe2f4.tar.xz
cuberite-fc940b6da4fd446e718879a19790af03dadfe2f4.tar.zst
cuberite-fc940b6da4fd446e718879a19790af03dadfe2f4.zip
Diffstat (limited to '')
-rw-r--r--src/MobSpawner.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/MobSpawner.cpp b/src/MobSpawner.cpp
index 216681b48..05da5d01c 100644
--- a/src/MobSpawner.cpp
+++ b/src/MobSpawner.cpp
@@ -205,7 +205,7 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
case cMonster::mtSpider:
{
bool CanSpawn = true;
- bool HaveFloor = false;
+ bool HasFloor = false;
for (int x = 0; x < 2; ++x)
{
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;
}
- HaveFloor = (
- a_Chunk->UnboundedRelGetBlockType(a_RelX + x, a_RelY - 1 /* Checked at start of function */, a_RelZ + z, TargetBlock) &&
- !cBlockInfo::IsTransparent(TargetBlock)
+ HasFloor = (
+ HasFloor ||
+ (
+ a_Chunk->UnboundedRelGetBlockType(a_RelX + x, a_RelY - 1, a_RelZ + z, TargetBlock) &&
+ !cBlockInfo::IsTransparent(TargetBlock)
+ )
);
}
}
- return CanSpawn && HaveFloor && (SkyLight <= 7) && (BlockLight <= 7);
+ return CanSpawn && HasFloor && (SkyLight <= 7) && (BlockLight <= 7);
}
case cMonster::mtCreeper: