diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-03 06:49:58 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-03 06:49:58 +0000 |
commit | 84a6e8527deb1305ce0ed6124bfc0e9513c0900b (patch) | |
tree | b36726751bb916b08367f48b7de47e7ecd47ed9b /crawl-ref/source/direct.cc | |
parent | 8e921b6d07237f6a5b2501cc13ee09d08bf9cc30 (diff) | |
download | crawl-ref-84a6e8527deb1305ce0ed6124bfc0e9513c0900b.tar.gz crawl-ref-84a6e8527deb1305ce0ed6124bfc0e9513c0900b.zip |
Improve beam selection by trying to match slopes (well, munged slopes) to the
slope to the target. We use the average of the beam slope and the slope of the
starting point of the beam from the center of the starting cell.
This picks better beams for points close to the player - (2,1) for instance
than my first attempt.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1515 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/direct.cc')
-rw-r--r-- | crawl-ref/source/direct.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index 9b6407c8be..59429c4349 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -831,6 +831,11 @@ bool in_vlos(int x, int y) && (env.show[x - LOS_SX][y] || (x == VIEW_CX && y == VIEW_CY)); } +bool in_vlos(const coord_def &pos) +{ + return (in_vlos(pos.x, pos.y)); +} + bool in_los(int x, int y) { const int tx = x + VIEW_CX - you.x_pos, |