summaryrefslogtreecommitdiffstats
path: root/src/Simulator
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-22 21:06:15 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-22 21:06:15 +0100
commit48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a (patch)
tree6a3222e51cd91198ed347ef473442e0464dab6f7 /src/Simulator
parentImplemented knockback and critical hit (diff)
downloadcuberite-48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a.tar
cuberite-48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a.tar.gz
cuberite-48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a.tar.bz2
cuberite-48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a.tar.lz
cuberite-48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a.tar.xz
cuberite-48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a.tar.zst
cuberite-48b388aa97fa5e3819f91ab6a77dfdc4af5b1a0a.zip
Diffstat (limited to 'src/Simulator')
-rw-r--r--src/Simulator/RedstoneSimulator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Simulator/RedstoneSimulator.cpp b/src/Simulator/RedstoneSimulator.cpp
index 10b750aeb..c26663aa1 100644
--- a/src/Simulator/RedstoneSimulator.cpp
+++ b/src/Simulator/RedstoneSimulator.cpp
@@ -899,7 +899,7 @@ void cRedstoneSimulator::HandleNoteBlock(int a_BlockX, int a_BlockY, int a_Block
void cRedstoneSimulator::HandleDaylightSensor(int a_BlockX, int a_BlockY, int a_BlockZ)
{
- for (int Y = a_BlockY + 1; Y < 10; Y++)
+ for (int Y = a_BlockY + 1; Y < cChunkDef::Height; Y++)
{
if (!g_BlockTransparent[m_World.GetBlock(a_BlockX, Y, a_BlockZ)])
{
@@ -907,7 +907,8 @@ void cRedstoneSimulator::HandleDaylightSensor(int a_BlockX, int a_BlockY, int a_
}
}
- if (m_World.GetSkyDarkness() < 8)
+ NIBBLETYPE SkyLight = m_World.GetBlockSkyLight(a_BlockX, a_BlockY + 1, a_BlockZ) - m_World.GetSkyDarkness();
+ if (SkyLight > 8)
{
SetAllDirsAsPowered(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_DAYLIGHT_SENSOR);
}