diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-29 09:04:02 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-29 09:04:02 -0700 |
commit | 0187f66a01fb38f6683f528770a69652af90b35e (patch) | |
tree | 62527d378c4a7331c1cebc3de967a038248d0984 /src/being.cpp | |
parent | 68f3b73a82999b8ee8c7937b9da8060af1f3b691 (diff) | |
download | mana-0187f66a01fb38f6683f528770a69652af90b35e.tar.gz mana-0187f66a01fb38f6683f528770a69652af90b35e.tar.bz2 mana-0187f66a01fb38f6683f528770a69652af90b35e.tar.xz mana-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.cpp | 4 |
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) |