From fa6e376242d7e7de95ff8419b226286b650fe304 Mon Sep 17 00:00:00 2001 From: Enne Walker Date: Sun, 29 Nov 2009 13:29:27 -0500 Subject: Change mapgrd and mapbld funcs to be 0-indexed. All the other dgn and map functions in Crawl are 0-indexed, so this makes everything more consistent. I've changed all the uses in the master branch, but if you're using these functions in another branch (dpeg and due), then you'll need to adjust all your coordinates to match. --- crawl-ref/source/l_mapgrd.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/l_mapgrd.cc') diff --git a/crawl-ref/source/l_mapgrd.cc b/crawl-ref/source/l_mapgrd.cc index efefb583c5..f3098cfc23 100644 --- a/crawl-ref/source/l_mapgrd.cc +++ b/crawl-ref/source/l_mapgrd.cc @@ -40,12 +40,12 @@ static char* mapgrd_glyph(lua_State *ls, int &col, int &row) col = mapc->col; map_lines &lines = mapc->map->map; - if (row < 1 || col < 1 || col > lines.width() || row > lines.height()) + if (row < 0 || col < 0 || col >= lines.width() || row >= lines.height()) { return (NULL); } - coord_def mc(col - 1, row - 1); + coord_def mc(col, row); return (&lines(mc)); } -- cgit v1.2.3-54-g00ecf