Fixed region boundary issue with relighting code

This commit is contained in:
Justin Aquadro 2011-04-11 08:17:52 +00:00
parent 2adf6ced99
commit de21e4d94c

View file

@ -187,6 +187,11 @@ namespace Substrate
public ChunkRef GetChunkRef (int lcx, int lcz, IChunkCache cache)
{
if (lcx < 0 || lcx >= 32 || lcz < 0 || lcz >= 32) {
Region alt = _regionMan.GetRegion(_rx + (lcx >> 5), _rz + (lcz >> 5));
return alt.GetChunkRef((lcx + 3200) % 32, (lcz + 3200) % 32, cache);
}
ChunkKey k = new ChunkKey(lcx, lcz);
ChunkRef c = null;