mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-05 23:09:04 +00:00
Fix bug #45 crash in zone lighter with large number of CPU cores
This commit is contained in:
parent
da53f11c73
commit
f83fdf5a2f
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue