Fix divide by zero crash in zone lighter

feature/pre-code-move
kaetemi 5 years ago committed by Jan Boon
parent 8d48c8ee74
commit 761770d4eb

@ -1179,6 +1179,8 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight
// Set the thread state
_LastPatchComputed.resize (_ProcessCount);
if (patchCount)
{
// Launch threads
uint process;
for (process = 0; process < _ProcessCount; process++)
@ -1210,6 +1212,11 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight
// Call the progress callback
progress("Lighting patches", (float)_NumberOfPatchComputed / (float)_PatchInfo.size());
}
}
else
{
nlwarning("Empty zone");
}
// Reset old thread mask
currentThread->setCPUMask (threadMask);

Loading…
Cancel
Save