summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/message.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-01 16:17:33 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-01 16:17:33 +0000
commit0cf6b82ebfe4d9db9171e426c39bac61aa932b77 (patch)
tree28d7f7da727824c47941ad90ed5b73c42e61611a /crawl-ref/source/message.cc
parent8083cf858ffe734bfe8940421b746d332175eba3 (diff)
downloadcrawl-ref-0cf6b82ebfe4d9db9171e426c39bac61aa932b77.tar.gz
crawl-ref-0cf6b82ebfe4d9db9171e426c39bac61aa932b77.zip
Suppress equipment, diagnostic and tutorial channels in character dump message
history. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1170 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/message.cc')
-rw-r--r--crawl-ref/source/message.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index d1b1a45ff8..8872f7b226 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -572,6 +572,13 @@ void more(void)
Message_Line >= get_message_window_height() - 1 );
} // end more()
+static bool is_channel_dumpworthy(int channel)
+{
+ return (channel != MSGCH_EQUIPMENT
+ && channel != MSGCH_DIAGNOSTICS
+ && channel != MSGCH_TUTORIAL);
+}
+
std::string get_last_messages(int mcount)
{
if (mcount <= 0) return std::string();
@@ -586,9 +593,11 @@ std::string get_last_messages(int mcount)
int count = 0;
for (int i = initial; i != Next_Message; )
{
- if (Store_Message[i].text.length())
+ const message_item &msg = Store_Message[i];
+
+ if (msg.text.length() && is_channel_dumpworthy(msg.channel))
{
- text += Store_Message[i].text;
+ text += msg.text;
text += EOL;
count++;
}