summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-28 13:43:46 -0700
committerIra Rice <irarice@gmail.com>2009-01-28 13:43:46 -0700
commit487b7237a730469fc4f8a501a93f78c2bbafad51 (patch)
treebaae7f42eb6ab634057ad29e7cba2bc914c85551 /src/being.cpp
parent8b71ee703caa6bf289f25d8c7118636592771412 (diff)
downloadmana-487b7237a730469fc4f8a501a93f78c2bbafad51.tar.gz
mana-487b7237a730469fc4f8a501a93f78c2bbafad51.tar.bz2
mana-487b7237a730469fc4f8a501a93f78c2bbafad51.tar.xz
mana-487b7237a730469fc4f8a501a93f78c2bbafad51.zip
Removed manual trimmings in exchange for using trim.h instead.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 985be69c..9de03502 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -46,7 +46,8 @@
#include "utils/dtor.h"
#include "utils/gettext.h"
-#include "utils/tostring.h"
+#include "utils/tostring.h"
+#include "utils/trim.h"
#include "utils/xml.h"
int Being::instances = 0;
@@ -176,14 +177,7 @@ void Being::setSpeech(const std::string &text, Uint32 time)
mSpeech = text;
// Trim whitespace
- while (mSpeech[0] == ' ')
- {
- mSpeech = mSpeech.substr(1, mSpeech.size());
- }
- while (mSpeech[mSpeech.size()] == ' ')
- {
- mSpeech = mSpeech.substr(0, mSpeech.size() - 1);
- }
+ trim(mSpeech);
// check for links
std::string::size_type start = mSpeech.find('[');