From 736f9e85fc99dbb33a166e5c85fead2e41b143b7 Mon Sep 17 00:00:00 2001 From: Warmist Date: Mon, 24 Jun 2013 01:26:25 +0300 Subject: [PATCH] Fixed skylight --- plugins/rendermax/renderer_light.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index ccc1ae55f..187b3d2d8 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -279,7 +279,7 @@ void lightingEngineViewscreen::doOcupancyAndLights() } int totalBlank = 0; int topLevel = df::global::world->map.z_count-1; - for(int ZZ = topLevel; (ZZ >= window_z) && totalBlank < 257; ZZ--) + for(int ZZ = topLevel; (ZZ >= window_z) && totalBlank < 256; ZZ--) { df::map_block* block=Maps::getBlock(blockx,blocky,ZZ); totalBlank = 0; @@ -324,7 +324,7 @@ void lightingEngineViewscreen::doOcupancyAndLights() pos.y = blocky*16+block_y; int wx=pos.x-window_x+vp.first.x; int wy=pos.y-window_y+vp.first.y; - + if(wx>=vp.first.x && wy>=vp.first.y && wx<=vp.second.x && wy<=vp.second.y) if(cellArray[block_x][block_y].r >= 0.003f && cellArray[block_x][block_y].g >= 0.003f && cellArray[block_x][block_y].b >= 0.003f) { lightSource sun=lightSource(cellArray[block_x][block_y],15);