From 84a6e8527deb1305ce0ed6124bfc0e9513c0900b Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 3 Jun 2007 06:49:58 +0000 Subject: 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 --- crawl-ref/source/direct.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crawl-ref/source/direct.cc') 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, -- cgit v1.2.3-54-g00ecf