--- ray/src/rt/source.c 1991/10/28 08:08:19 1.48 +++ ray/src/rt/source.c 1992/04/12 10:05:32 2.3 @@ -41,6 +41,7 @@ static int maxcntr = 0; /* size of contribution arra marksources() /* find and mark source objects */ { + int foundsource = 0; int i; register OBJREC *o, *m; register int ns; @@ -93,8 +94,10 @@ marksources() /* find and mark source objects */ source[ns].sflags |= SSKIP; } } + if (!(source[ns].sflags & SSKIP)) + foundsource++; } - if (nsources <= 0) { + if (!foundsource) { error(WARNING, "no light sources found"); return; } @@ -261,6 +264,8 @@ char *p; /* data for f */ l = m; } } + if (ncnts == 0) + return; /* no contributions! */ /* accumulate tail */ for (sn = ncnts-1; sn > 0; sn--) cntord[sn-1].brt += cntord[sn].brt;