From f83fdf5a2fa181bb82fadfd191a0626c774b44e4 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 24 Jul 2013 20:51:43 +0200 Subject: [PATCH] Fix bug #45 crash in zone lighter with large number of CPU cores --- code/nel/src/3d/zone_lighter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 112df54e0..0fe7e9b48 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -1170,8 +1170,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight { // Last patch uint lastPatch=firstPatch+patchCountByThread; - if (lastPatch>patchCount) - lastPatch=patchCount; + lastPatch %= patchCount; // Last patch computed _LastPatchComputed[process] = firstPatch; @@ -3772,6 +3771,8 @@ uint CZoneLighter::getAPatch (uint process) uint index = _LastPatchComputed[process]; uint firstIndex = index; + nlassert(index < _PatchInfo.size()); + if (access.value().size() == 0) // no more patches return 0xffffffff;