From 0cf6b82ebfe4d9db9171e426c39bac61aa932b77 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 1 Apr 2007 16:17:33 +0000 Subject: 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 --- crawl-ref/source/message.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/message.cc') 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++; } -- cgit v1.2.3-54-g00ecf