--- ray/src/rt/source.c 1991/06/20 16:36:41 1.36 +++ ray/src/rt/source.c 1991/06/26 14:10:29 1.38 @@ -75,7 +75,7 @@ marksources() /* find and mark source objects */ if ((ns = newsource()) < 0) goto memerr; - (*sfun[o->otype].of->setsrc)(&source[ns], o); + setsource(&source[ns], o); if (m->otype == MAT_GLOW) { source[ns].sflags |= SPROX; @@ -86,6 +86,12 @@ marksources() /* find and mark source objects */ source[ns].sflags |= SSPOT; if ((source[ns].sl.s = makespot(m)) == NULL) goto memerr; + if (source[ns].sflags & SFLAT && + !checkspot(source[ns].sl.s,source[ns].snorm)) { + objerror(o, WARNING, + "invalid spotlight direction"); + source[ns].sflags |= SSKIP; + } } } if (nsources <= 0) {