From e1a06153b2e93473af58e1d801998ff7f388dc6d Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Tue, 29 Oct 2013 10:44:51 -0600 Subject: Update to allow the light map to remain the same, but allow alteration of sky light values based on time. --- source/Chunk.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/Chunk.cpp') diff --git a/source/Chunk.cpp b/source/Chunk.cpp index c419cf7f2..b38f5ea19 100644 --- a/source/Chunk.cpp +++ b/source/Chunk.cpp @@ -533,8 +533,7 @@ void cChunk::SpawnMobs(cMobSpawner& a_MobSpawner) if (IsLightValid()) { - int TimeOfDay = m_World->GetTimeOfDay(); - cEntity* newMob = a_MobSpawner.TryToSpawnHere(this, Try_X, Try_Y, Try_Z, Biome, TimeOfDay, MaxNbOfSuccess); + cEntity* newMob = a_MobSpawner.TryToSpawnHere(this, Try_X, Try_Y, Try_Z, Biome, MaxNbOfSuccess); if (newMob) { int WorldX, WorldY, WorldZ; @@ -2787,6 +2786,16 @@ Vector3i cChunk::PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ) +NIBBLETYPE cChunk::GetTimeAlteredLight(NIBBLETYPE a_Skylight) const +{ + a_Skylight -= m_World->GetSkyDarkness(); + return (a_Skylight < 16)? a_Skylight : 0; +} + + + + + #if !C_CHUNK_USE_INLINE # include "cChunk.inl.h" #endif -- cgit v1.2.3