summaryrefslogtreecommitdiff
path: root/src/localplayer.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/localplayer.cpp
parent8dea62750ab3a44e0f35f2543bbb6ccf2a9470ce (diff)
parent193ea898e5f549c14c0e4cd0d060785de4fb4bcf (diff)
downloadmanaplus-502a0a0163e702af7334979a2eabfc4826a94091.tar.gz
manaplus-502a0a0163e702af7334979a2eabfc4826a94091.tar.bz2
manaplus-502a0a0163e702af7334979a2eabfc4826a94091.tar.xz
manaplus-502a0a0163e702af7334979a2eabfc4826a94091.zip
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 3df4a3214..bd69d785f 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -354,7 +354,8 @@ void LocalPlayer::logic()
}
}
- if (mEnableAdvert && !mBlockAdvert && mAdvertTime < cur_time)
+ if (serverVersion < 4 && mEnableAdvert && !mBlockAdvert
+ && mAdvertTime < cur_time)
{
Uint8 smile = FLAG_SPECIAL;
if (mTradebot && shopWindow && !shopWindow->isShopEmpty())
@@ -3442,6 +3443,7 @@ void LocalPlayer::setAway(const std::string &message)
if (!message.empty())
config.setValue("afkMessage", message);
changeAwayMode();
+ updateStatus();
}
void LocalPlayer::setPseudoAway(const std::string &message)
@@ -4207,11 +4209,30 @@ const char *LocalPlayer::getVarItem(const char **arr, unsigned index,
return arr[sz];
}
+void LocalPlayer::updateStatus()
+{
+ if (serverVersion >= 4 && mEnableAdvert)
+ {
+ Uint8 status = 0;
+ if (mTradebot && shopWindow && !shopWindow->isShopEmpty())
+ status += FLAG_SHOP;
+
+ if (mAwayMode || mPseudoAwayMode)
+ status += FLAG_AWAY;
+
+ if (mInactive)
+ status += FLAG_INACTIVE;
+
+ Net::getPlayerHandler()->updateStatus(status);
+ }
+}
+
void AwayListener::action(const gcn::ActionEvent &event)
{
if (event.getId() == "ok" && player_node && player_node->getAway())
{
player_node->changeAwayMode();
+ player_node->updateStatus();
if (outfitWindow)
outfitWindow->unwearAwayOutfit();
if (miniStatusWindow)