summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/xom.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-09 00:43:46 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-09 00:43:46 +0000
commitd2fccb02f632f2c70da8d25d6bb90cac62311c3d (patch)
tree3864f253563c344695fc39ab26868b969fc6a506 /crawl-ref/source/xom.cc
parenta40073ac317d8fffd4d456c9ead4649646ce1803 (diff)
downloadcrawl-ref-d2fccb02f632f2c70da8d25d6bb90cac62311c3d.tar.gz
crawl-ref-d2fccb02f632f2c70da8d25d6bb90cac62311c3d.zip
Prevent unneeded message if Xom flips you from piety == 100 to piety = 100
[2450763]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8345 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 5daaa4414a..ccb973cbf5 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -2047,13 +2047,14 @@ void xom_acts(bool niceness, int sever)
if (you.religion == GOD_XOM && coinflip())
{
+ const std::string old_xom_favour = describe_xom_favour();
you.piety = MAX_PIETY - you.piety;
-
- char buf[8192];
- strcpy(buf, "Your title is now: ");
- const char *newfavour = describe_xom_favour();
- strcat(buf, newfavour);
- god_speaks( you.religion, buf );
+ const std::string new_xom_favour = describe_xom_favour();
+ if (old_xom_favour != new_xom_favour)
+ {
+ const std::string msg = "Your title is now: " + new_xom_favour;
+ god_speaks( you.religion, msg.c_str() );
+ }
}
}