From 0187f66a01fb38f6683f528770a69652af90b35e Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 29 Jan 2009 09:04:02 -0700 Subject: Make sure that strings aren't chopped off when a | isn't found. Signed-off-by: Ira Rice --- src/being.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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) -- cgit v1.2.3-70-g09d2