Make travel consider traps like closed doors

Test case: U-shaped corridor, with a known trap in it.
Before this change, travel would try to move straight at
the target, bumping the wall or walking into a dead-end.
After this, travel will go along the corridor and then stop
right before the trap.

Original patch via AceHack by Alex Smith.
This commit is contained in:
Pasi Kallinen
2015-12-21 17:31:04 +02:00
parent c86ae780c4
commit 9a2eb370e7
3 changed files with 13 additions and 5 deletions

View File

@@ -277,6 +277,7 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define DO_MOVE 0 /* really doing the move */
#define TEST_MOVE 1 /* test a normal move (move there next) */
#define TEST_TRAV 2 /* test a future travel location */
#define TEST_TRAP 3 /* check if a future travel loc is a trap */
/*** some utility macros ***/
#define yn(query) yn_function(query, ynchars, 'n')