diff options
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 23 |
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) |