34 |
|
extern char *amblist[]; /* ambient include/exclude list */ |
35 |
|
extern int ambincl; /* include == 1, exclude == 0 */ |
36 |
|
|
37 |
< |
OBJECT ambset[256]={0}; /* ambient include/exclude set */ |
37 |
> |
#define MAXASET 511 /* maximum number of elements in ambient set */ |
38 |
> |
OBJECT ambset[MAXASET+1]={0}; /* ambient include/exclude set */ |
39 |
|
|
40 |
|
double maxarad; /* maximum ambient radius */ |
41 |
|
double minarad; /* minimum ambient radius */ |
102 |
|
ambnotify(obj) /* record new modifier */ |
103 |
|
OBJECT obj; |
104 |
|
{ |
105 |
+ |
static int hitlimit = 0; |
106 |
|
register OBJREC *o = objptr(obj); |
107 |
|
register char **amblp; |
108 |
|
|
109 |
< |
if (!ismodifier(o->otype)) |
109 |
> |
if (hitlimit || !ismodifier(o->otype)) |
110 |
|
return; |
111 |
|
for (amblp = amblist; *amblp != NULL; amblp++) |
112 |
|
if (!strcmp(o->oname, *amblp)) { |
113 |
+ |
if (ambset[0] >= MAXASET) { |
114 |
+ |
error(WARNING, "too many modifiers in ambient list"); |
115 |
+ |
hitlimit++; |
116 |
+ |
return; /* should this be fatal? */ |
117 |
+ |
} |
118 |
|
insertelem(ambset, obj); |
119 |
|
return; |
120 |
|
} |