-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.276 $ $NHDT-Date: 1596785361 2020/08/07 07:29:21 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.277 $ $NHDT-Date: 1596841504 2020/08/07 23:05:04 $
General Fixes and Modified Features
-----------------------------------
"{acid,blinding} venom" to "splash of {acid,blinding} venom"
wizard mode #timeout changed to show timed Displacement in 'can be timed in
normal play' section instead of 'timed via #wizintrinsic only' section
+the fix to make worm visibility checks work as intended forced the coordinates
+ of the extra tail segment co-located with the worm monster to match
+ the worm instead of leaving it off the map; place_worm_tail_randomly()
+ reverses the segments and can throw some away if there isn't room,
+ but throwing away the extra segment removed the worm from the map
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
-/* NetHack 3.7 worm.c $NHDT-Date: 1596498230 2020/08/03 23:43:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.46 $ */
+/* NetHack 3.7 worm.c $NHDT-Date: 1596841504 2020/08/07 23:05:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.47 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2009. */
/* NetHack may be freely redistributed. See license for details. */
impossible("place_worm_tail_randomly: wormno is set without a tail!");
return;
}
+ if (wtails[wnum] == wheads[wnum]) {
+ /* single segment, co-located with worm so nothing to place */
+ if (curr->wx != worm->mx || curr->wy != worm->my)
+ impossible(
+ "place_worm_tail_randomly: tail segement at <%d,%d>, worm at <%d,%d>",
+ curr->wx, curr->wy, worm->mx, worm->my);
+ return;
+ }
+ /* remove head segment from map in case we end up calling toss_wsegs();
+ if it doesn't get tossed, it will become the final tail segment and
+ get new coordinates */
+ wheads[wnum]->wx = wheads[wnum]->wy = 0;
wheads[wnum] = new_tail = curr;
curr = curr->nseg;
while (curr) {
xchar nx, ny;
- char tryct = 0;
+ int tryct = 0;
/* pick a random direction from x, y and search for goodpos() */
do {