diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-20 16:55:46 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-20 16:55:46 -0700 |
commit | 567cd92eae386c28b6af90121d0f8f575dce0687 (patch) | |
tree | 2efc5800ad53ff06f4b38ef30efd0a73565f00e1 | |
parent | 1b3ac1ad7a745ed7b7aac1f1dd7514616db8a998 (diff) | |
download | mana-client-567cd92eae386c28b6af90121d0f8f575dce0687.tar.gz mana-client-567cd92eae386c28b6af90121d0f8f575dce0687.tar.bz2 mana-client-567cd92eae386c28b6af90121d0f8f575dce0687.tar.xz mana-client-567cd92eae386c28b6af90121d0f8f575dce0687.zip |
Repaired text messages. While trimming out the link code is still a good
idea for the speech, I accidently trimmed it down to just the item name
before.
Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r-- | src/being.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/being.cpp b/src/being.cpp index 3e621295..7643c91b 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -187,19 +187,16 @@ void Being::setSpeech(const std::string &text, Uint32 time) if (start != std::string::npos && end != std::string::npos) { - mSpeech.erase(end); - std::string::size_type pos = mSpeech.find('@'); + std::string::size_type position = mSpeech.find('|'); + mSpeech.erase(end, 1); + mSpeech.erase(start, (position - start) + 1); + position = mSpeech.find('@'); - while (pos != std::string::npos) + while (position != std::string::npos) { - mSpeech.erase(pos, 2); - pos = mSpeech.find('@'); + mSpeech.erase(position, 2); + position = mSpeech.find('@'); } - - pos = mSpeech.find('|'); - - if (pos != std::string::npos) - mSpeech = mSpeech.substr(pos + 1, mSpeech.size()); } if (mSpeech != "") |