summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/message.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-29 20:11:21 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-29 20:11:21 +0000
commit82fd8b10b5d975349ddb4088f205401687d75f7b (patch)
treeab44ea237731ac2a88648e98f2dcca93d1b8af47 /crawl-ref/source/message.cc
parent6b1ce5dda57255e4f6bc166a27b3b071739ac5d1 (diff)
downloadcrawl-ref-82fd8b10b5d975349ddb4088f205401687d75f7b.tar.gz
crawl-ref-82fd8b10b5d975349ddb4088f205401687d75f7b.zip
Fix trunk compile, and a bit of code clean-up.
Oh, and filter MSGCH_PROMPT from message history. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3488 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/message.cc')
-rw-r--r--crawl-ref/source/message.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index dec1ebb5d6..a90d285f83 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -529,7 +529,19 @@ static void mpr_check_patterns(const std::string& message,
}
}
}
+}
+static bool channel_message_history(msg_channel_type channel)
+{
+ switch (channel)
+ {
+ case MSGCH_PROMPT:
+ case MSGCH_EQUIPMENT:
+ case MSGCH_EXAMINE_FILTER:
+ return (false);
+ default:
+ return (true);
+ }
}
// adds a given message to the message history
@@ -551,7 +563,7 @@ static void mpr_store_messages(const std::string& message,
textcolor(LIGHTGREY);
// equipment lists just waste space in the message recall
- if (channel != MSGCH_EQUIPMENT && channel != MSGCH_EXAMINE_FILTER)
+ if (channel_message_history(channel))
{
// Put the message into Store_Message, and move the '---' line forward
Store_Message[ Next_Message ].text = message;
@@ -711,7 +723,7 @@ void formatted_message_history(const std::string &st_nocolor, msg_channel_type c
std::vector<formatted_string> fss;
formatted_string::parse_string_to_multiple(st, fss);
- for (int i=0; i<fss.size(); i++)
+ for (unsigned int i=0; i<fss.size(); i++)
{
const formatted_string& fs = fss[i];
const std::string unformatted = fs.tostring();