summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_mapgrd.cc
diff options
context:
space:
mode:
authorEnne Walker <ennewalker@users.sourceforge.net>2009-11-29 13:29:27 -0500
committerEnne Walker <ennewalker@users.sourceforge.net>2009-11-29 13:39:23 -0500
commitfa6e376242d7e7de95ff8419b226286b650fe304 (patch)
treeab7315676f1c1af3d0eccc632b9db422c60bb10c /crawl-ref/source/l_mapgrd.cc
parente9dc6e7d4fec48cbadc3ad9459c5f047a6d82aa5 (diff)
downloadcrawl-ref-fa6e376242d7e7de95ff8419b226286b650fe304.tar.gz
crawl-ref-fa6e376242d7e7de95ff8419b226286b650fe304.zip
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.
Diffstat (limited to 'crawl-ref/source/l_mapgrd.cc')
-rw-r--r--crawl-ref/source/l_mapgrd.cc4
1 files changed, 2 insertions, 2 deletions
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));
}