summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2013-10-23 01:10:32 +0200
committerSamuel Barney <samjbarney@gmail.com>2013-10-23 01:10:32 +0200
commitd6d73a1754b67bc38404dcac54947812076b83ea (patch)
tree7a79986eb62ce94f7f58635747e5f26cfc880439 /source
parentAdded two new unbounded del functions to deal with looking up the lighting. (diff)
downloadcuberite-d6d73a1754b67bc38404dcac54947812076b83ea.tar
cuberite-d6d73a1754b67bc38404dcac54947812076b83ea.tar.gz
cuberite-d6d73a1754b67bc38404dcac54947812076b83ea.tar.bz2
cuberite-d6d73a1754b67bc38404dcac54947812076b83ea.tar.lz
cuberite-d6d73a1754b67bc38404dcac54947812076b83ea.tar.xz
cuberite-d6d73a1754b67bc38404dcac54947812076b83ea.tar.zst
cuberite-d6d73a1754b67bc38404dcac54947812076b83ea.zip
Diffstat (limited to 'source')
-rw-r--r--source/Chunk.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/Chunk.cpp b/source/Chunk.cpp
index ea6fed50c..32a8b5c0f 100644
--- a/source/Chunk.cpp
+++ b/source/Chunk.cpp
@@ -544,7 +544,7 @@ void cChunk::SpawnMobs(cMobSpawner& a_MobSpawner)
NIBBLETYPE BlockLight = UnboundedRelGetBlockLight(Try_X, Try_Y, Try_Z);
- if (IsLightValid())
+ if (IsLightValid() && (SkyLight != 127) && (BlockLight != 127))
{
cEntity* newMob = a_MobSpawner.TryToSpawnHere(BlockType, BlockMeta, BlockType_below, BlockMeta_below, BlockType_above, BlockMeta_above, SkyLight, BlockLight, Biome, Try_Y, MaxNbOfSuccess);
if (newMob)
@@ -1361,7 +1361,7 @@ NIBBLETYPE cChunk::UnboundedRelGetSkyLight(int a_RelX, int a_RelY, int a_RelZ)
if ((a_RelY < 0) || (a_RelY > cChunkDef::Height))
{
LOGWARNING("UnboundedRelGetSkyLight(): requesting a block with a_RelY out of range: %d", a_RelY);
- return -1;
+ return 127;
}
// Is it in this chunk?
@@ -1369,7 +1369,7 @@ if ((a_RelY < 0) || (a_RelY > cChunkDef::Height))
{
if (!IsValid())
{
- return -1;
+ return 127;
}
return GetSkyLight(a_RelX, a_RelY, a_RelZ);
}
@@ -1409,7 +1409,7 @@ NIBBLETYPE cChunk::UnboundedRelGetBlockLight(int a_RelX, int a_RelY, int a_RelZ)
if ((a_RelY < 0) || (a_RelY > cChunkDef::Height))
{
LOGWARNING("UnboundedRelGetBlockLight(): requesting a block with a_RelY out of range: %d", a_RelY);
- return -1;
+ return 127;
}
// Is it in this chunk?
@@ -1417,7 +1417,7 @@ if ((a_RelY < 0) || (a_RelY > cChunkDef::Height))
{
if (!IsValid())
{
- return -1;
+ return 127;
}
return GetBlockLight(a_RelX, a_RelY, a_RelZ);
}