From d2fccb02f632f2c70da8d25d6bb90cac62311c3d Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 9 Jan 2009 00:43:46 +0000 Subject: 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 --- crawl-ref/source/xom.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/xom.cc') 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() ); + } } } -- cgit v1.2.3-54-g00ecf