From c33b616ae863e94189d4cc5d7ec071de0ef0ab1f Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Sat, 4 Jun 2011 06:01:30 +0000 Subject: [PATCH] lighting range bugfix --- Substrate/SubstrateCS/Properties/AssemblyInfo.cs | 4 ++-- Substrate/SubstrateCS/Source/BlockLight.cs | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Substrate/SubstrateCS/Properties/AssemblyInfo.cs b/Substrate/SubstrateCS/Properties/AssemblyInfo.cs index 269ca0e..ef4b76e 100644 --- a/Substrate/SubstrateCS/Properties/AssemblyInfo.cs +++ b/Substrate/SubstrateCS/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("0.5.1.0")] -[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyVersion("0.5.2.0")] +[assembly: AssemblyFileVersion("0.5.2.0")] diff --git a/Substrate/SubstrateCS/Source/BlockLight.cs b/Substrate/SubstrateCS/Source/BlockLight.cs index 4f32754..0afd08f 100644 --- a/Substrate/SubstrateCS/Source/BlockLight.cs +++ b/Substrate/SubstrateCS/Source/BlockLight.cs @@ -69,13 +69,19 @@ namespace Substrate _update.Enqueue(primary); BlockInfo info = _blockset.GetInfo(lx, ly, lz); + //if (info.Luminance > BlockInfo.MIN_LUMINANCE || info.TransmitsLight) { - QueueRelight(new BlockKey(lx - 1, ly, lz)); - QueueRelight(new BlockKey(lx + 1, ly, lz)); + if (ly > 0) { QueueRelight(new BlockKey(lx, ly - 1, lz)); + } + if (ly < _ydim - 1) { QueueRelight(new BlockKey(lx, ly + 1, lz)); - QueueRelight(new BlockKey(lx, ly, lz - 1)); - QueueRelight(new BlockKey(lx, ly, lz + 1)); + } + + QueueRelight(new BlockKey(lx - 1, ly, lz)); + QueueRelight(new BlockKey(lx + 1, ly, lz)); + QueueRelight(new BlockKey(lx, ly, lz - 1)); + QueueRelight(new BlockKey(lx, ly, lz + 1)); //} UpdateBlockLight();