summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-29 09:04:02 -0700
committerIra Rice <irarice@gmail.com>2009-01-29 09:04:02 -0700
commit0187f66a01fb38f6683f528770a69652af90b35e (patch)
tree62527d378c4a7331c1cebc3de967a038248d0984 /src/being.cpp
parent68f3b73a82999b8ee8c7937b9da8060af1f3b691 (diff)
downloadmana-client-0187f66a01fb38f6683f528770a69652af90b35e.tar.gz
mana-client-0187f66a01fb38f6683f528770a69652af90b35e.tar.bz2
mana-client-0187f66a01fb38f6683f528770a69652af90b35e.tar.xz
mana-client-0187f66a01fb38f6683f528770a69652af90b35e.zip
Make sure that strings aren't chopped off when a | isn't found.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp
index e2495bc0..dc36adc2 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -194,8 +194,10 @@ void Being::setSpeech(const std::string &text, Uint32 time)
std::string::size_type position = mSpeech.find('|');
if (mSpeech[start + 1] == '@' && mSpeech[start + 2] == '@')
+ {
mSpeech.erase(end, 1);
- mSpeech.erase(start, (position - start) + 1);
+ mSpeech.erase(start, (position - start) + 1);
+ }
position = mSpeech.find('@');
while (position != std::string::npos)