Core/Player: prevent trade system from getting stuck in an invalid state when the LevelReq.Trade config is used.

This commit is contained in:
Wyrserth
2019-07-13 00:50:26 +02:00
parent 81475f709f
commit a54af39e29

View File

@@ -628,6 +628,8 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
info.Status = TRADE_STATUS_CLOSE_WINDOW;
SendTradeStatus(info);
return;
}
@@ -701,6 +703,8 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
if (pOther->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
info.Status = TRADE_STATUS_CLOSE_WINDOW;
SendTradeStatus(info);
return;
}