diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
commit | ab678324e3d73e2354cef331624ecef7cfc03203 (patch) | |
tree | 29394a5aca6e59f817f7cfa3b9281891a273d259 /src/being.cpp | |
parent | 32badd4b6f843cb74fdc3238fe92119518c8c0ab (diff) | |
download | mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.gz mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.bz2 mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.xz mana-ab678324e3d73e2354cef331624ecef7cfc03203.zip |
Added a toString conversion function.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/being.cpp b/src/being.cpp index 5ee8276c..a74efe5f 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -22,8 +22,6 @@ */ #include "being.h" -#include <sstream> - #include "game.h" #include "graphics.h" #include "log.h" @@ -33,6 +31,8 @@ #include "gui/gui.h" +#include "utils/tostring.h" + extern Spriteset *emotionset; PATH_NODE::PATH_NODE(Uint16 iX, Uint16 iY): @@ -120,13 +120,7 @@ Being::setSpeech(const std::string &text, Uint32 time) void Being::setDamage(Sint16 amount, Uint32 time) { - if (!amount) { - mDamage = "miss"; - } else { - std::stringstream damageString; - damageString << amount; - mDamage = damageString.str(); - } + mDamage = amount ? toString(amount) : "miss"; mDamageTime = tick_time; mShowDamage = true; } |