diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-11-22 02:45:31 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-11-22 02:45:31 +0100 |
commit | 02ba3863cec303b2257e9c4d254fe7f338bda320 (patch) | |
tree | c40a67c36d36b06f87568d75af2d33d5526e5612 /crawl-ref/source/dgn-layouts.cc | |
parent | 2ade8afc15f4ac30e8c0a5595ab9caa56b0ff947 (diff) | |
download | crawl-ref-02ba3863cec303b2257e9c4d254fe7f338bda320.tar.gz crawl-ref-02ba3863cec303b2257e9c4d254fe7f338bda320.zip |
Let _make_trail() fail if it painted itself into a corner.
Diffstat (limited to 'crawl-ref/source/dgn-layouts.cc')
-rw-r--r-- | crawl-ref/source/dgn-layouts.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/dgn-layouts.cc b/crawl-ref/source/dgn-layouts.cc index 28f23e5f69..7d1ecfc4a8 100644 --- a/crawl-ref/source/dgn-layouts.cc +++ b/crawl-ref/source/dgn-layouts.cc @@ -347,12 +347,16 @@ static void _make_trail(int xs, int xr, int ys, int yr, int corrlength, if (tries < 0) return; + tries = 200; // assign begin position begin = pos; // wander while (finish < no_corr) { + if (!(tries--)) // give up after 200 tries + return; + dir.reset(); // Put something in to make it go to parts of map it isn't in now. |