zeromonst
Make 'zeromonst' global instead of local to makemon.c. Its address isn't used as a special value like &zeroobj, but it is useful to have available for initializing various pseudo-monsters. modified: include/decl.h src/decl.c, makemon.c, mkobj.c, mplayer.c, teleport.c
This commit is contained in:
@@ -107,13 +107,11 @@ struct obj *otmp;
|
||||
{
|
||||
if (!otmp->oextra)
|
||||
otmp->oextra = newoextra();
|
||||
|
||||
if (!OMONST(otmp)) {
|
||||
struct monst *m = newmonst();
|
||||
|
||||
/* newmonst() allocates memory but doesn't initialize anything */
|
||||
(void) memset((genericptr_t) m, 0, sizeof (struct monst));
|
||||
m->mextra = (struct mextra *) 0;
|
||||
m->nmon = (struct monst *) 0;
|
||||
*m = zeromonst;
|
||||
OMONST(otmp) = m;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user