From 16f4be755988dd1fb4b4918ab5c2e43fe721d4b9 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Sat, 31 Oct 2009 20:54:58 -0400 Subject: 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. --- crawl-ref/source/directn.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crawl-ref/source/directn.cc') 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()); } -- cgit v1.2.3-54-g00ecf