summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-20 16:55:46 -0700
committerIra Rice <irarice@gmail.com>2009-01-20 16:55:46 -0700
commit567cd92eae386c28b6af90121d0f8f575dce0687 (patch)
tree2efc5800ad53ff06f4b38ef30efd0a73565f00e1 /src/being.cpp
parent1b3ac1ad7a745ed7b7aac1f1dd7514616db8a998 (diff)
downloadmana-567cd92eae386c28b6af90121d0f8f575dce0687.tar.gz
mana-567cd92eae386c28b6af90121d0f8f575dce0687.tar.bz2
mana-567cd92eae386c28b6af90121d0f8f575dce0687.tar.xz
mana-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>
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp17
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 != "")