summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_dgnbld.cc
diff options
context:
space:
mode:
authorReid Barton <rwbarton@gmail.com>2012-12-07 15:23:39 -0500
committerReid Barton <rwbarton@gmail.com>2012-12-07 15:23:39 -0500
commit7469ab5f953998313dcd2c7d3c04091dbce5fc88 (patch)
treea3c8cba5f512680873222855c53c38854b000f0e /crawl-ref/source/l_dgnbld.cc
parentc2a34d3e58dc0e39a4a97953b31c5aeb8cf87cbe (diff)
downloadcrawl-ref-7469ab5f953998313dcd2c7d3c04091dbce5fc88.tar.gz
crawl-ref-7469ab5f953998313dcd2c7d3c04091dbce5fc88.zip
Fix computation of count in dgn_replace_random
This allows dgn_replace_random to be used on a single-square-wide or -tall rectangle.
Diffstat (limited to 'crawl-ref/source/l_dgnbld.cc')
-rw-r--r--crawl-ref/source/l_dgnbld.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/l_dgnbld.cc b/crawl-ref/source/l_dgnbld.cc
index dc51ab72f1..a9f5d72e45 100644
--- a/crawl-ref/source/l_dgnbld.cc
+++ b/crawl-ref/source/l_dgnbld.cc
@@ -764,7 +764,7 @@ LUAFN(dgn_replace_random)
if (!_coords(ls, lines, x1, y1, x2, y2))
return 0;
- int count = (x2 - x1) * (y2 - y1);
+ int count = (x2 - x1 + 1) * (y2 - y1 + 1);
if (!count)
{
if (required)