U453 and buglist item - travel command updates

I wrote to the devteam early last week:
> Given my understanding of travel, it's supposed to be somewhat intelligent,
> and "convenient", and should, therefore avoid walking into water, lava,
> traps, or other things that distant movement would avoid, even if you're
> right next it.  Unless...  the travel destination is the "bad" location
> next to you when the travel starts.
To that end...
- add a context (iflags in 3.4.3 to maintain savefile compat) flag to
differenciate the first travel step from later steps, to allow the
detection of the final sentence, above.
- several changes to set/reset the travel1 flag as needed
- add code to findtravelpath to treat the first step specially if it's
the only step, allowing forced travel into a "bad" location
- correct the "don't travel over traps" code, which was getting confused
because hero's starting location was being avoided
- add code to avoid traveling into water and lava, duplicating
checks used for non-travel running
- fix some strange "guess" travel behavior: avoid zigzag paths when there's
a more direct path (even though the number of moves is the same)
- trunk change adds a new DISP_ALL tmp_at type, and uses it in some debug
code for travel, debug changes not added to the 3.4.3 branch
This commit is contained in:
cohrs
2003-10-21 02:27:43 +00:00
parent 4e09be0163
commit 231b2b16f8
7 changed files with 101 additions and 19 deletions

View File

@@ -834,6 +834,7 @@ tmp_at(x, y)
switch (x) {
case DISP_BEAM:
case DISP_ALL:
case DISP_FLASH:
case DISP_ALWAYS:
if (!tglyph)
@@ -868,7 +869,7 @@ tmp_at(x, y)
break;
case DISP_END:
if (tglyph->style == DISP_BEAM) {
if (tglyph->style == DISP_BEAM || tglyph->style == DISP_ALL) {
register int i;
/* Erase (reset) from source to end */
@@ -885,8 +886,9 @@ tmp_at(x, y)
break;
default: /* do it */
if (tglyph->style == DISP_BEAM) {
if (!cansee(x,y)) break;
if (tglyph->style == DISP_BEAM || tglyph->style == DISP_ALL) {
if (tglyph->style != DISP_ALL && !cansee(x,y)) break;
if (tglyph->sidx >= COLNO) break; /* too many locations */
/* save pos for later erasing */
tglyph->saved[tglyph->sidx].x = x;
tglyph->saved[tglyph->sidx].y = y;