mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10541] Allow set afk/dnd message in afk/dnd state
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
0ec380e380
commit
3bc4f053cc
2 changed files with 21 additions and 16 deletions
|
|
@ -453,17 +453,21 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
|||
std::string msg;
|
||||
recv_data >> msg;
|
||||
|
||||
if((msg.empty() || !_player->isAFK()) && !_player->isInCombat() )
|
||||
if (!_player->isInCombat())
|
||||
{
|
||||
if(!_player->isAFK())
|
||||
if (!msg.empty() || !_player->isAFK())
|
||||
{
|
||||
if(msg.empty())
|
||||
msg = GetMangosString(LANG_PLAYER_AFK_DEFAULT);
|
||||
_player->afkMsg = msg;
|
||||
if (msg.empty())
|
||||
_player->afkMsg = GetMangosString(LANG_PLAYER_AFK_DEFAULT);
|
||||
else
|
||||
_player->afkMsg = msg;
|
||||
}
|
||||
if (msg.empty() || !_player->isAFK())
|
||||
{
|
||||
_player->ToggleAFK();
|
||||
if (_player->isAFK() && _player->isDND())
|
||||
_player->ToggleDND();
|
||||
}
|
||||
_player->ToggleAFK();
|
||||
if(_player->isAFK() && _player->isDND())
|
||||
_player->ToggleDND();
|
||||
}
|
||||
} break;
|
||||
|
||||
|
|
@ -472,16 +476,17 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
|||
std::string msg;
|
||||
recv_data >> msg;
|
||||
|
||||
if(msg.empty() || !_player->isDND())
|
||||
if (!msg.empty() || !_player->isDND())
|
||||
{
|
||||
if(!_player->isDND())
|
||||
{
|
||||
if(msg.empty())
|
||||
msg = GetMangosString(LANG_PLAYER_DND_DEFAULT);
|
||||
if (msg.empty())
|
||||
_player->dndMsg = GetMangosString(LANG_PLAYER_DND_DEFAULT);
|
||||
else
|
||||
_player->dndMsg = msg;
|
||||
}
|
||||
}
|
||||
if (msg.empty() || !_player->isDND())
|
||||
{
|
||||
_player->ToggleDND();
|
||||
if(_player->isDND() && _player->isAFK())
|
||||
if (_player->isDND() && _player->isAFK())
|
||||
_player->ToggleAFK();
|
||||
}
|
||||
} break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue