diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-28 21:00:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-28 21:00:12 +0300 |
commit | a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1 (patch) | |
tree | b4ade374e591f520ae49b1dcb3317b19d503f089 /src/being.cpp | |
parent | e5695ad6c41d4deb79504998b2bc5caeb1e61285 (diff) | |
download | manaplus-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.gz manaplus-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.bz2 manaplus-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.xz manaplus-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.zip |
Add support for processing player statuses in evol server.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 37 |
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 { |