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

(cherry picked from commit a54af39e29)
This commit is contained in:
Wyrserth
2019-07-13 00:50:26 +02:00
committed by Shauren
parent 49bc6533fd
commit 1b7a1c51ae

View File

@@ -613,6 +613,8 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade&
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
info.Status = TRADE_STATUS_FAILED;
SendTradeStatus(info);
return;
}
@@ -687,6 +689,8 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade&
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_FAILED;
SendTradeStatus(info);
return;
}