26
src/zap.c
26
src/zap.c
@@ -618,22 +618,24 @@ montraits(struct obj *obj, coord *cc,
|
|||||||
boolean adjacentok) /* False: at obj's spot only, True: nearby is
|
boolean adjacentok) /* False: at obj's spot only, True: nearby is
|
||||||
allowed */
|
allowed */
|
||||||
{
|
{
|
||||||
struct monst *mtmp, *mtmp2 = has_omonst(obj) ? get_mtraits(obj, TRUE) : 0;
|
struct monst *mtmp = (struct monst *) 0,
|
||||||
|
*mtmp2 = has_omonst(obj) ? get_mtraits(obj, TRUE) : 0;
|
||||||
|
|
||||||
if (mtmp2) {
|
if (mtmp2) {
|
||||||
/* save_mtraits() validated mtmp2->mnum */
|
/* save_mtraits() validated mtmp2->mnum */
|
||||||
mtmp2->data = &mons[mtmp2->mnum];
|
mtmp2->data = &mons[mtmp2->mnum];
|
||||||
if (mtmp2->mhpmax <= 0 && !is_rider(mtmp2->data))
|
|
||||||
return (struct monst *) 0;
|
if (!(mtmp2->mhpmax <= 0 && !is_rider(mtmp2->data))) {
|
||||||
mtmp = makemon(mtmp2->data, cc->x, cc->y,
|
mtmp = makemon(mtmp2->data, cc->x, cc->y,
|
||||||
(NO_MINVENT | MM_NOWAIT | MM_NOCOUNTBIRTH
|
(NO_MINVENT | MM_NOWAIT | MM_NOCOUNTBIRTH
|
||||||
/* in case mtmp2 is a long worm; saved traits for
|
/* in case mtmp2 is a long worm; saved traits for
|
||||||
long worm don't include tail segments so don't
|
long worm don't include tail segments so don't
|
||||||
give mtmp any; it will be given a new 'wormno'
|
give mtmp any; it will be given a new 'wormno'
|
||||||
though (unless those are exhausted) so be able
|
though (unless those are exhausted) so be able
|
||||||
to grow new tail segments */
|
to grow new tail segments */
|
||||||
| MM_NOTAIL | MM_NOMSG
|
| MM_NOTAIL | MM_NOMSG
|
||||||
| (adjacentok ? MM_ADJACENTOK : 0)));
|
| (adjacentok ? MM_ADJACENTOK : 0)));
|
||||||
|
}
|
||||||
if (!mtmp) {
|
if (!mtmp) {
|
||||||
/* mtmp2 is a copy of obj's object->oextra->omonst extension
|
/* mtmp2 is a copy of obj's object->oextra->omonst extension
|
||||||
and is not on the map or on any monst lists */
|
and is not on the map or on any monst lists */
|
||||||
|
|||||||
Reference in New Issue
Block a user