mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[10821] Restore anti-cheating check work at buy item
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
534d43daa1
commit
5f099d5fc0
2 changed files with 12 additions and 15 deletions
|
|
@ -18692,21 +18692,18 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorGuid, uint32 vendorslot, uin
|
||||||
|
|
||||||
if (crItem->item != item) // store diff item (cheating or special convert)
|
if (crItem->item != item) // store diff item (cheating or special convert)
|
||||||
{
|
{
|
||||||
ItemPrototype const* crProto = ObjectMgr::GetItemPrototype(crItem->item);
|
bool converted = false;
|
||||||
// possible item coverting for BoA case
|
|
||||||
if (crProto->Flags & ITEM_FLAG_BOA)
|
|
||||||
{
|
|
||||||
// convert if can use and then buy
|
|
||||||
if (crProto->RequiredReputationFaction && uint32(GetReputationRank(crProto->RequiredReputationFaction)) >= crProto->RequiredReputationRank)
|
|
||||||
{
|
|
||||||
uint32 newitemid = sObjectMgr.GetItemConvert(crItem->item, getRaceMask());
|
|
||||||
|
|
||||||
if (newitemid != item) // store diff item (cheating or special convert)
|
// possible item converted for BoA case
|
||||||
{
|
ItemPrototype const* crProto = ObjectMgr::GetItemPrototype(crItem->item);
|
||||||
SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
if (crProto->Flags & ITEM_FLAG_BOA && crProto->RequiredReputationFaction &&
|
||||||
return false;
|
uint32(GetReputationRank(crProto->RequiredReputationFaction)) >= crProto->RequiredReputationRank)
|
||||||
}
|
converted = item == sObjectMgr.GetItemConvert(crItem->item, getRaceMask());;
|
||||||
}
|
|
||||||
|
if(!converted)
|
||||||
|
{
|
||||||
|
SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10820"
|
#define REVISION_NR "10821"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue