domove_ variables did not need to be in saved context
This commit is contained in:
@@ -117,10 +117,6 @@ struct context_info {
|
|||||||
int rndencode; /* randomized escape sequence introducer */
|
int rndencode; /* randomized escape sequence introducer */
|
||||||
long next_attrib_check; /* next attribute check */
|
long next_attrib_check; /* next attribute check */
|
||||||
long stethoscope_move;
|
long stethoscope_move;
|
||||||
long domove_attempting;
|
|
||||||
long domove_succeeded;
|
|
||||||
#define DOMOVE_WALK 0x00000001
|
|
||||||
#define DOMOVE_RUSH 0x00000002
|
|
||||||
short stethoscope_movement;
|
short stethoscope_movement;
|
||||||
boolean travel; /* find way automatically to u.tx,u.ty */
|
boolean travel; /* find way automatically to u.tx,u.ty */
|
||||||
boolean travel1; /* first travel step */
|
boolean travel1; /* first travel step */
|
||||||
|
|||||||
@@ -691,6 +691,10 @@ struct instance_globals {
|
|||||||
int doorindex;
|
int doorindex;
|
||||||
char *save_cm;
|
char *save_cm;
|
||||||
long done_money;
|
long done_money;
|
||||||
|
long domove_attempting;
|
||||||
|
long domove_succeeded;
|
||||||
|
#define DOMOVE_WALK 0x00000001
|
||||||
|
#define DOMOVE_RUSH 0x00000002
|
||||||
const char *nomovemsg;
|
const char *nomovemsg;
|
||||||
char plname[PL_NSIZ]; /* player name */
|
char plname[PL_NSIZ]; /* player name */
|
||||||
char pl_character[PL_CSIZ];
|
char pl_character[PL_CSIZ];
|
||||||
|
|||||||
@@ -579,7 +579,6 @@ newgame()
|
|||||||
g.context.botlx = 1;
|
g.context.botlx = 1;
|
||||||
g.context.ident = 1;
|
g.context.ident = 1;
|
||||||
g.context.stethoscope_move = -1L;
|
g.context.stethoscope_move = -1L;
|
||||||
g.context.domove_attempting = 0L;
|
|
||||||
g.context.warnlevel = 1;
|
g.context.warnlevel = 1;
|
||||||
g.context.next_attrib_check = 600L; /* arbitrary first setting */
|
g.context.next_attrib_check = 600L; /* arbitrary first setting */
|
||||||
g.context.tribute.enabled = TRUE; /* turn on 3.6 tributes */
|
g.context.tribute.enabled = TRUE; /* turn on 3.6 tributes */
|
||||||
|
|||||||
@@ -4562,7 +4562,7 @@ register char *cmd;
|
|||||||
case NHKF_RUSH:
|
case NHKF_RUSH:
|
||||||
if (movecmd(cmd[1])) {
|
if (movecmd(cmd[1])) {
|
||||||
g.context.run = 2;
|
g.context.run = 2;
|
||||||
g.context.domove_attempting |= DOMOVE_RUSH;
|
g.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4573,7 +4573,7 @@ register char *cmd;
|
|||||||
case NHKF_RUN:
|
case NHKF_RUN:
|
||||||
if (movecmd(lowc(cmd[1]))) {
|
if (movecmd(lowc(cmd[1]))) {
|
||||||
g.context.run = 3;
|
g.context.run = 3;
|
||||||
g.context.domove_attempting |= DOMOVE_RUSH;
|
g.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4589,7 +4589,7 @@ register char *cmd;
|
|||||||
case NHKF_FIGHT:
|
case NHKF_FIGHT:
|
||||||
if (movecmd(cmd[1])) {
|
if (movecmd(cmd[1])) {
|
||||||
g.context.forcefight = 1;
|
g.context.forcefight = 1;
|
||||||
g.context.domove_attempting |= DOMOVE_WALK;
|
g.domove_attempting |= DOMOVE_WALK;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4598,7 +4598,7 @@ register char *cmd;
|
|||||||
g.context.run = 0;
|
g.context.run = 0;
|
||||||
g.context.nopick = 1;
|
g.context.nopick = 1;
|
||||||
if (!u.dz)
|
if (!u.dz)
|
||||||
g.context.domove_attempting |= DOMOVE_WALK;
|
g.domove_attempting |= DOMOVE_WALK;
|
||||||
else
|
else
|
||||||
cmd[0] = cmd[1]; /* "m<" or "m>" */
|
cmd[0] = cmd[1]; /* "m<" or "m>" */
|
||||||
} else
|
} else
|
||||||
@@ -4608,7 +4608,7 @@ register char *cmd;
|
|||||||
if (movecmd(lowc(cmd[1]))) {
|
if (movecmd(lowc(cmd[1]))) {
|
||||||
g.context.run = 1;
|
g.context.run = 1;
|
||||||
g.context.nopick = 1;
|
g.context.nopick = 1;
|
||||||
g.context.domove_attempting |= DOMOVE_RUSH;
|
g.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4631,20 +4631,20 @@ register char *cmd;
|
|||||||
g.context.travel1 = 1;
|
g.context.travel1 = 1;
|
||||||
g.context.run = 8;
|
g.context.run = 8;
|
||||||
g.context.nopick = 1;
|
g.context.nopick = 1;
|
||||||
g.context.domove_attempting |= DOMOVE_RUSH;
|
g.domove_attempting |= DOMOVE_RUSH;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*FALLTHRU*/
|
/*FALLTHRU*/
|
||||||
default:
|
default:
|
||||||
if (movecmd(*cmd)) { /* ordinary movement */
|
if (movecmd(*cmd)) { /* ordinary movement */
|
||||||
g.context.run = 0; /* only matters here if it was 8 */
|
g.context.run = 0; /* only matters here if it was 8 */
|
||||||
g.context.domove_attempting |= DOMOVE_WALK;
|
g.domove_attempting |= DOMOVE_WALK;
|
||||||
} else if (movecmd(g.Cmd.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
|
} else if (movecmd(g.Cmd.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
|
||||||
g.context.run = 1;
|
g.context.run = 1;
|
||||||
g.context.domove_attempting |= DOMOVE_RUSH;
|
g.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else if (movecmd(unctrl(*cmd))) {
|
} else if (movecmd(unctrl(*cmd))) {
|
||||||
g.context.run = 3;
|
g.context.run = 3;
|
||||||
g.context.domove_attempting |= DOMOVE_RUSH;
|
g.domove_attempting |= DOMOVE_RUSH;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4662,7 +4662,7 @@ register char *cmd;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((g.context.domove_attempting & (DOMOVE_RUSH | DOMOVE_WALK)) != 0L)
|
if (((g.domove_attempting & (DOMOVE_RUSH | DOMOVE_WALK)) != 0L)
|
||||||
&& !g.context.travel && !dxdy_moveok()) {
|
&& !g.context.travel && !dxdy_moveok()) {
|
||||||
/* trying to move diagonally as a grid bug;
|
/* trying to move diagonally as a grid bug;
|
||||||
this used to be treated by movecmd() as not being
|
this used to be treated by movecmd() as not being
|
||||||
@@ -4677,13 +4677,13 @@ register char *cmd;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((g.context.domove_attempting & DOMOVE_WALK) != 0L) {
|
if ((g.domove_attempting & DOMOVE_WALK) != 0L) {
|
||||||
if (g.multi)
|
if (g.multi)
|
||||||
g.context.mv = TRUE;
|
g.context.mv = TRUE;
|
||||||
domove();
|
domove();
|
||||||
g.context.forcefight = 0;
|
g.context.forcefight = 0;
|
||||||
return;
|
return;
|
||||||
} else if ((g.context.domove_attempting & DOMOVE_RUSH) != 0L) {
|
} else if ((g.domove_attempting & DOMOVE_RUSH) != 0L) {
|
||||||
if (firsttime) {
|
if (firsttime) {
|
||||||
if (!g.multi)
|
if (!g.multi)
|
||||||
g.multi = max(COLNO, ROWNO);
|
g.multi = max(COLNO, ROWNO);
|
||||||
|
|||||||
@@ -262,6 +262,8 @@ const struct instance_globals g_init = {
|
|||||||
0, /* doorindex */
|
0, /* doorindex */
|
||||||
NULL, /* save_cm */
|
NULL, /* save_cm */
|
||||||
0, /* done_money */
|
0, /* done_money */
|
||||||
|
0L, /* domove_attempting */
|
||||||
|
0L, /* domove_succeeded */
|
||||||
NULL, /* nomovemsg */
|
NULL, /* nomovemsg */
|
||||||
DUMMY, /* plname */
|
DUMMY, /* plname */
|
||||||
DUMMY, /* pl_character */
|
DUMMY, /* pl_character */
|
||||||
|
|||||||
+6
-6
@@ -1332,12 +1332,12 @@ domove()
|
|||||||
{
|
{
|
||||||
int ux1 = u.ux, uy1 = u.uy;
|
int ux1 = u.ux, uy1 = u.uy;
|
||||||
|
|
||||||
g.context.domove_succeeded = 0L;
|
g.domove_succeeded = 0L;
|
||||||
domove_core();
|
domove_core();
|
||||||
/* g.context.domove_succeeded is available to make assessments now */
|
/* g.domove_succeeded is available to make assessments now */
|
||||||
if ((g.context.domove_succeeded & (DOMOVE_RUSH | DOMOVE_WALK)) != 0)
|
if ((g.domove_succeeded & (DOMOVE_RUSH | DOMOVE_WALK)) != 0)
|
||||||
maybe_smudge_engr(ux1, uy1, u.ux, u.uy);
|
maybe_smudge_engr(ux1, uy1, u.ux, u.uy);
|
||||||
g.context.domove_attempting = 0L;
|
g.domove_attempting = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1872,8 +1872,8 @@ domove_core()
|
|||||||
|
|
||||||
if (u.ux0 != u.ux || u.uy0 != u.uy) {
|
if (u.ux0 != u.ux || u.uy0 != u.uy) {
|
||||||
/* let caller know so that an evaluation may take place */
|
/* let caller know so that an evaluation may take place */
|
||||||
g.context.domove_succeeded |=
|
g.domove_succeeded |=
|
||||||
(g.context.domove_attempting & (DOMOVE_RUSH | DOMOVE_WALK));
|
(g.domove_attempting & (DOMOVE_RUSH | DOMOVE_WALK));
|
||||||
u.umoved = TRUE;
|
u.umoved = TRUE;
|
||||||
/* Clean old position -- vision_recalc() will print our new one. */
|
/* Clean old position -- vision_recalc() will print our new one. */
|
||||||
newsym(u.ux0, u.uy0);
|
newsym(u.ux0, u.uy0);
|
||||||
|
|||||||
Reference in New Issue
Block a user