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 zap.c $NHDT-Date: 1589491666 2020/05/14 21:27:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.340 $ */
/* NetHack 3.6 zap.c $NHDT-Date: 1591178401 2020/06/03 10:00:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.341 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -586,6 +586,11 @@ boolean adjacentok; /* False: at obj's spot only, True: nearby is allowed */
return (struct monst *) 0;
mtmp = makemon(mtmp2->data, cc->x, cc->y,
(NO_MINVENT | MM_NOWAIT | MM_NOCOUNTBIRTH
/* in case mtmp2 is a long worm; saved traits for
long worm don't include tail segments so don't
give mtmp any; it will be given a new 'wormno'
though unless those are exhausted */
| MM_NOTAIL
| (adjacentok ? MM_ADJACENTOK : 0)));
if (!mtmp) {
/* mtmp2 is a copy of obj's object->oextra->omonst extension