summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/message.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-18 06:09:54 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-18 06:09:54 +0000
commitc4aac587234c1eebad7fb400de5486a5ac73cd38 (patch)
tree29584db5e66272a3e5a39e5fed95c94180f42ef9 /crawl-ref/source/message.cc
parentd95060f1e6fa1e397bc95ea43c239b3019e3fb2f (diff)
downloadcrawl-ref-c4aac587234c1eebad7fb400de5486a5ac73cd38.tar.gz
crawl-ref-c4aac587234c1eebad7fb400de5486a5ac73cd38.zip
When dumping info upon a crash:
* For Unix builds, shut down curses in case the crash reporter can't open up a file and has to dump the crash directly to stderr. * Include all saved messages in the crash report. * Use EOL instead of \n or \r\n. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8535 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/message.cc')
-rw-r--r--crawl-ref/source/message.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index 7bda843e10..30f4f8f341 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -1010,7 +1010,15 @@ std::string get_last_messages(int mcount)
bool full_buffer = (Store_Message[NUM_STORED_MESSAGES - 1].text.empty());
int initial = Next_Message - mcount;
if (initial < 0 || initial > NUM_STORED_MESSAGES)
- initial = full_buffer ? initial + NUM_STORED_MESSAGES : 0;
+ {
+ if (full_buffer)
+ {
+ initial = (initial + NUM_STORED_MESSAGES) % NUM_STORED_MESSAGES;
+ initial++;
+ }
+ else
+ initial = 0;
+ }
std::string text;
int count = 0;