SF patch 536615: travel cache

This is derived from the proposed patch and feedback to it.  This applies
the last-position cache behavior without an option, making the behavior
more like it is for interfaces with a mouse, where holding the mouse still
acts the same way as the travel cache.  The code is not #ifdef'd either.
This commit is contained in:
cohrs
2003-06-30 04:00:14 +00:00
parent cec8e1ee31
commit b633b91875
5 changed files with 14 additions and 5 deletions

View File

@@ -2413,15 +2413,20 @@ dotravel()
if (!flags.travelcmd) return 0;
cmd[1]=0;
cc.x = u.ux;
cc.y = u.uy;
cc.x = iflags.travelcc.x;
cc.y = iflags.travelcc.y;
if (cc.x == -1 && cc.y == -1) {
/* No cached destination, start attempt from current position */
cc.x = u.ux;
cc.y = u.uy;
}
pline("Where do you want to travel to?");
if (getpos(&cc, TRUE, "the desired destination") < 0) {
/* user pressed ESC */
return 0;
}
u.tx = cc.x;
u.ty = cc.y;
iflags.travelcc.x = u.tx = cc.x;
iflags.travelcc.y = u.ty = cc.y;
cmd[0] = CMD_TRAVEL;
readchar_queue = cmd;
return 0;