domove_core() out of domove(); assess domove_core() results

new domove_core() assessment results

potentially smudge engravings

Proceed to wipe engraving after domove_core() now, but only under
all of the following conditions:
    - you can reach the floor
    - preceding domove_core() move attempt was marked as
      having succeeded in domove_core()
    - there is actually an engraving there to impact at
      your original spot, or your new spot, or both
This commit is contained in:
nhmall
2019-01-27 11:55:23 -05:00
parent d63c9d866c
commit 55fdfb9200
5 changed files with 64 additions and 17 deletions

View File

@@ -4538,7 +4538,7 @@ rhack(cmd)
register char *cmd;
{
int spkey;
boolean do_walk, do_rush, prefix_seen, bad_command,
boolean prefix_seen, bad_command,
firsttime = (cmd == 0);
iflags.menu_requested = FALSE;
@@ -4569,7 +4569,7 @@ register char *cmd;
}
/* handle most movement commands */
do_walk = do_rush = prefix_seen = FALSE;
prefix_seen = FALSE;
context.travel = context.travel1 = 0;
spkey = ch2spkeys(*cmd, NHKF_RUN, NHKF_CLICKLOOK);
@@ -4577,7 +4577,7 @@ register char *cmd;
case NHKF_RUSH:
if (movecmd(cmd[1])) {
context.run = 2;
do_rush = TRUE;
domove_attempting |= DOMOVE_RUSH;
} else
prefix_seen = TRUE;
break;
@@ -4588,7 +4588,7 @@ register char *cmd;
case NHKF_RUN:
if (movecmd(lowc(cmd[1]))) {
context.run = 3;
do_rush = TRUE;
domove_attempting |= DOMOVE_RUSH;
} else
prefix_seen = TRUE;
break;
@@ -4604,7 +4604,7 @@ register char *cmd;
case NHKF_FIGHT:
if (movecmd(cmd[1])) {
context.forcefight = 1;
do_walk = TRUE;
domove_attempting |= DOMOVE_WALK;
} else
prefix_seen = TRUE;
break;
@@ -4613,7 +4613,7 @@ register char *cmd;
context.run = 0;
context.nopick = 1;
if (!u.dz)
do_walk = TRUE;
domove_attempting |= DOMOVE_WALK;
else
cmd[0] = cmd[1]; /* "m<" or "m>" */
} else
@@ -4623,7 +4623,7 @@ register char *cmd;
if (movecmd(lowc(cmd[1]))) {
context.run = 1;
context.nopick = 1;
do_rush = TRUE;
domove_attempting |= DOMOVE_RUSH;
} else
prefix_seen = TRUE;
break;
@@ -4646,20 +4646,20 @@ register char *cmd;
context.travel1 = 1;
context.run = 8;
context.nopick = 1;
do_rush = TRUE;
domove_attempting |= DOMOVE_RUSH;
break;
}
/*FALLTHRU*/
default:
if (movecmd(*cmd)) { /* ordinary movement */
context.run = 0; /* only matters here if it was 8 */
do_walk = TRUE;
domove_attempting |= DOMOVE_WALK;
} else if (movecmd(Cmd.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
context.run = 1;
do_rush = TRUE;
domove_attempting |= DOMOVE_RUSH;
} else if (movecmd(unctrl(*cmd))) {
context.run = 3;
do_rush = TRUE;
domove_attempting |= DOMOVE_RUSH;
}
break;
}
@@ -4677,7 +4677,8 @@ register char *cmd;
}
}
if ((do_walk || do_rush) && !context.travel && !dxdy_moveok()) {
if (((domove_attempting & (DOMOVE_RUSH | DOMOVE_WALK)) != 0L)
&& !context.travel && !dxdy_moveok()) {
/* trying to move diagonally as a grid bug;
this used to be treated by movecmd() as not being
a movement attempt, but that didn't provide for any
@@ -4691,13 +4692,13 @@ register char *cmd;
return;
}
if (do_walk) {
if ((domove_attempting & DOMOVE_WALK) != 0L) {
if (multi)
context.mv = TRUE;
domove();
context.forcefight = 0;
return;
} else if (do_rush) {
} else if ((domove_attempting & DOMOVE_RUSH) != 0L) {
if (firsttime) {
if (!multi)
multi = max(COLNO, ROWNO);