summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/message.cc
diff options
context:
space:
mode:
authorelliptic <hyperelliptical@gmail.com>2014-03-18 01:04:33 -0400
committerelliptic <hyperelliptical@gmail.com>2014-03-18 01:05:16 -0400
commita5c58e37d87fdacdbe7fb0cc319b36a3cd57a6cb (patch)
treeff930ef7fa55ea8098eaca9702f43e6bac096d70 /crawl-ref/source/message.cc
parenta180b4f40a21e2dd11fb4f565591252652d7a5b2 (diff)
downloadcrawl-ref-a5c58e37d87fdacdbe7fb0cc319b36a3cd57a6cb.tar.gz
crawl-ref-a5c58e37d87fdacdbe7fb0cc319b36a3cd57a6cb.zip
Fix repeated messages lacking their x2 in character dumps (crate).
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 0d3cc14427..55134d84c9 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -118,6 +118,14 @@ struct message_item
return text + rep;
}
+ string pure_text_with_repeats() const
+ {
+ string rep = "";
+ if (repeats > 1)
+ rep = make_stringf(" x%d", repeats);
+ return pure_text() + rep;
+ }
+
// Tries to condense the argument into this message.
// Either *this needs to be an empty item, or it must be the
// same as the argument.
@@ -1564,7 +1572,7 @@ string get_last_messages(int mcount, bool full)
if (!msg)
break;
if (full || is_channel_dumpworthy(msg.channel))
- text = msg.pure_text() + "\n" + text;
+ text = msg.pure_text_with_repeats() + "\n" + text;
mcount--;
}