add some long worm comments
and keep the remove_monster()+place_monster() followed by worm_move() operations together. No change in behavior.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 monmove.c $NHDT-Date: 1575245074 2019/12/02 00:04:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.116 $ */
|
||||
/* NetHack 3.6 monmove.c $NHDT-Date: 1579616424 2020/01/21 14:20:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.128 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1286,20 +1286,27 @@ register int after;
|
||||
if (!m_in_out_region(mtmp, nix, niy))
|
||||
return 3;
|
||||
|
||||
/* move a normal monster; for a long worm, remove_monster() and
|
||||
place_monster() only manipulate the head; they leave tail as-is */
|
||||
remove_monster(omx, omy);
|
||||
place_monster(mtmp, nix, niy);
|
||||
/* for a long worm, insert a new segment to reconnect the head
|
||||
with the tail; worm_move() keeps the end of the tail if worm
|
||||
is scheduled to grow, removes that for move-without-growing */
|
||||
if (mtmp->wormno)
|
||||
worm_move(mtmp);
|
||||
|
||||
for (j = MTSZ - 1; j > 0; j--)
|
||||
mtmp->mtrack[j] = mtmp->mtrack[j - 1];
|
||||
mtmp->mtrack[0].x = omx;
|
||||
mtmp->mtrack[0].y = omy;
|
||||
/* Place a segment at the old position. */
|
||||
if (mtmp->wormno)
|
||||
worm_move(mtmp);
|
||||
} else {
|
||||
if (is_unicorn(ptr) && rn2(2) && !tele_restrict(mtmp)) {
|
||||
(void) rloc(mtmp, TRUE);
|
||||
return 1;
|
||||
}
|
||||
/* for a long worm, shrink it (by discarding end of tail) when
|
||||
it has failed to move */
|
||||
if (mtmp->wormno)
|
||||
worm_nomove(mtmp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user