summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-10-31 20:54:58 -0400
committerCharles Otto <ottochar@gmail.com>2009-10-31 20:55:48 -0400
commit16f4be755988dd1fb4b4918ab5c2e43fe721d4b9 (patch)
treec156cb9632048878e58ed0842ddeac2155565462 /crawl-ref/source/directn.cc
parentada7f5b32b5b783b272e744082865f6f506b5bd2 (diff)
downloadcrawl-ref-16f4be755988dd1fb4b4918ab5c2e43fe721d4b9.tar.gz
crawl-ref-16f4be755988dd1fb4b4918ab5c2e43fe721d4b9.zip
Fix bug [2874237] monster info display corruption
Examining monsters with ctrl-X can lead to message corruption if the title and body fields of the describe_info struct used by process_description take up lines than fit in the message area. This patch avoid the problem by allowing process_description to print just the title field if title + body would take up too many lines. Also make view_desc_proc start one line later since it seemed to be trying to print the first line it was given one line above where it should have been.
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index dfa9dfd251..7dc912ccba 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -456,6 +456,12 @@ static void _direction_again(dist& moves, targetting_type restricts,
class view_desc_proc
{
public:
+ view_desc_proc()
+ {
+ // This thing seems to be starting off 1 line above where it
+ // should be. -cao
+ nextline();
+ }
int width() { return crawl_view.msgsz.x; }
int height() { return crawl_view.msgsz.y; }
void print(const std::string &str) { cprintf("%s", str.c_str()); }