summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-05 15:00:58 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-05 15:00:58 +0300
commit9a3a196dbf633a699c26d0227802a42f025c8bfd (patch)
treedfbdb2ff1e2c54d75a2bf6411d3f70df22518c28 /src/being.cpp
parentfc17ff22d9df50df9c5d1cf3dc0de358001271ed (diff)
parentece36a40d4e9a838cde01075d7681b8fc517b19f (diff)
downloadplus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.gz
plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.bz2
plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.xz
plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.zip
Merge branch 'master' into stripped
Conflicts: src/guichan/gui.cpp src/guichan/include/guichan/sdl/sdlpixel.hpp
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 39d0bd450..9edfaad7b 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -2517,26 +2517,31 @@ void Being::saveComment(const std::string &name,
resman->saveTextFile(dir, "comment.txt", name + "\n" + comment);
}
+void Being::setState(Uint8 state)
+{
+ mAdvanced = true;
+ bool shop = (state & FLAG_SHOP);
+ bool away = (state & FLAG_AWAY);
+ bool inactive = (state & FLAG_INACTIVE);
+ bool needUpdate = (shop != mShop || away != mAway
+ || inactive != mInactive);
+
+ mShop = shop;
+ mAway = away;
+ mInactive = inactive;
+
+ if (needUpdate)
+ {
+ updateName();
+ addToCache();
+ }
+}
+
void Being::setEmote(Uint8 emotion, int emote_time)
{
if ((emotion & FLAG_SPECIAL) == FLAG_SPECIAL)
{
- mAdvanced = true;
- bool shop = (emotion & FLAG_SHOP);
- bool away = (emotion & FLAG_AWAY);
- bool inactive = (emotion & FLAG_INACTIVE);
- bool needUpdate = (shop != mShop || away != mAway
- || inactive != mInactive);
-
- mShop = shop;
- mAway = away;
- mInactive = inactive;
-
- if (needUpdate)
- {
- updateName();
- addToCache();
- }
+ setState(emotion);
}
else
{