new makemon() flag

add a flag to makemon() to allow monster to be created adjacent to the supplied  coordinates if there is already a monster at the target location
This commit is contained in:
nethack.allison
2003-07-19 12:24:32 +00:00
parent 39a0544360
commit 9608015ac8
3 changed files with 15 additions and 3 deletions

View File

@@ -790,9 +790,18 @@ register int mmflags;
return((struct monst *)0);
}
/* if a monster already exists at the position, return */
if(MON_AT(x, y))
return((struct monst *) 0);
/* Does monster already exist at the position? */
if(MON_AT(x, y)) {
if ((mmflags & MM_ADJACENTOK) != 0) {
coord bypos;
if(enexto_core(&bypos, x, y, ptr, gpflags)) {
x = bypos.x;
y = bypos.y;
} else
return((struct monst *) 0);
} else
return((struct monst *) 0);
}
if(ptr){
mndx = monsndx(ptr);