fix stone-to-flesh on petrified long worm

montraits() didn't have any handling for long worm tails, makemon()
didn't have any provision for creating a long worm without a tail,
replmon() uses place_wegs() to put tail segments on the map when
replacing a dummy new monster with the mtraits one but place_wsegs()
wasn't updating the head segment since it isn't put on the map.

That turned out to be key because there is always an extra segment
co-located with the monster and when its coordinates were wrong,
worm_known() gave bad results for visibility checking.  The
statue-goes-away message was the one for not being able to see the
monster that it just animated into, even though 'w' appeared at the
spot.  It took quite a while to track down what was going on there.

Sanity checking for worms has been updated and could conceivably
start triggering complaints about things that it used ignore.
This commit is contained in:
PatR
2020-06-03 03:00:13 -07:00
parent 503df6823d
commit bb566e8a04
6 changed files with 79 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mkobj.c $NHDT-Date: 1590870787 2020/05/30 20:33:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */
/* NetHack 3.6 mkobj.c $NHDT-Date: 1591178399 2020/06/03 09:59:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.180 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1597,6 +1597,9 @@ struct monst *mtmp;
mtmp2->minvent = (struct obj *) 0;
if (mtmp->mextra)
copy_mextra(mtmp2, mtmp);
/* if mtmp is a long worm with segments, its saved traits will
be one without any segments */
mtmp2->wormno = 0;
}
return obj;
}