OSDN Git Service
(root)
/
hengbandforosx
/
hengbandosx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87f96e3
)
Virtical or holizontal direction is preferentially selected in traveling
author
habu
<habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 16 Feb 2013 08:31:39 +0000
(08:31 +0000)
committer
habu
<habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 16 Feb 2013 08:31:39 +0000
(08:31 +0000)
src/cmd1.c
patch
|
blob
|
history
diff --git
a/src/cmd1.c
b/src/cmd1.c
index
64d5345
..
acf655e
100644
(file)
--- a/
src/cmd1.c
+++ b/
src/cmd1.c
@@
-5087,11
+5087,13
@@
static int travel_test(int prev_dir)
cost = travel.cost[py][px];
/* Determine travel direction */
- for (i = 1; i<= 9; ++ i) {
- if (travel.cost[py+ddy[i]][px+ddx[i]] < cost)
+ for (i = 0; i < 8; ++ i) {
+ int dir_cost = travel.cost[py+ddy_ddd[i]][px+ddx_ddd[i]];
+
+ if (dir_cost < cost)
{
- new_dir =
i
;
- cost =
travel.cost[py+ddy[i]][px+ddx[i]]
;
+ new_dir =
ddd[i]
;
+ cost =
dir_cost
;
}
}