summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2012-01-30 15:27:30 +0100
committerReid <reidyaro@gmail.com>2012-01-30 15:27:30 +0100
commit502a0a0163e702af7334979a2eabfc4826a94091 (patch)
tree5e80ef76585b1718d7e74a411117c725fe3cb0e9 /src/being.cpp
parent8dea62750ab3a44e0f35f2543bbb6ccf2a9470ce (diff)
parent193ea898e5f549c14c0e4cd0d060785de4fb4bcf (diff)
downloadmv-502a0a0163e702af7334979a2eabfc4826a94091.tar.gz
mv-502a0a0163e702af7334979a2eabfc4826a94091.tar.bz2
mv-502a0a0163e702af7334979a2eabfc4826a94091.tar.xz
mv-502a0a0163e702af7334979a2eabfc4826a94091.zip
Merge branch 'master' of gitorious.org:manaplus/manaplus
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
{