summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg-mon.cc
diff options
context:
space:
mode:
authorFlorian Diebold <flodiebold@gmail.com>2011-11-23 17:41:27 +0100
committerFlorian Diebold <flodiebold@gmail.com>2011-11-23 19:07:21 +0100
commit98a29a69718851d541b643e90f928bbddcf76223 (patch)
tree867aa9f3b39ff2679afe503f5c4216e336bcaef4 /crawl-ref/source/tilereg-mon.cc
parent6eadb80a3d6f3fe069e95393535be9132ba978a4 (diff)
downloadcrawl-ref-98a29a69718851d541b643e90f928bbddcf76223.tar.gz
crawl-ref-98a29a69718851d541b643e90f928bbddcf76223.zip
Make monster_info::pos grid- instead of player-relative.
It was converted back everywhere it was used anywhere, and it became useless after the player moved. Mostly, the monster position is needed to refer back to the grid cell the monster is in, so as long as map_knowledge uses the normal grid coordinate system, monster_info should too. Note that Webtiles obscures coordinates in a better way already anyway, by using the coordinate of the first cell sent as origin and sticking to that coordinate system as long as the level doesn't change.
Diffstat (limited to 'crawl-ref/source/tilereg-mon.cc')
-rw-r--r--crawl-ref/source/tilereg-mon.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/tilereg-mon.cc b/crawl-ref/source/tilereg-mon.cc
index 099d7640ab..1d6070156c 100644
--- a/crawl-ref/source/tilereg-mon.cc
+++ b/crawl-ref/source/tilereg-mon.cc
@@ -70,7 +70,7 @@ int MonsterRegion::handle_mouse(MouseEvent &event)
if (!mon)
return (0);
- const coord_def &gc = player2grid(mon->pos);
+ const coord_def &gc = mon->pos;
tiles.place_cursor(CURSOR_MOUSE, gc);
if (event.event != MouseEvent::PRESS)
@@ -101,7 +101,7 @@ bool MonsterRegion::update_tip_text(std::string &tip)
if (!mon)
return (false);
- return (tile_dungeon_tip(player2grid(mon->pos), tip));
+ return (tile_dungeon_tip(mon->pos, tip));
}
bool MonsterRegion::update_tab_tip_text(std::string &tip, bool active)
@@ -125,7 +125,7 @@ bool MonsterRegion::update_alt_text(std::string &alt)
if (!mon)
return (false);
- const coord_def &gc = player2grid(mon->pos);
+ const coord_def &gc = mon->pos;
describe_info inf;
if (!you.see_cell(gc))
@@ -169,7 +169,7 @@ void MonsterRegion::pack_buffers()
const monster_info* mon = get_monster(i++);
if (mon)
{
- const coord_def gc = player2grid(mon->pos);
+ const coord_def gc = mon->pos;
const coord_def ep = grid2show(gc);
if (crawl_view.in_los_bounds_g(gc))