aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 4c605c6ef79..9a8345b67e9 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17670,7 +17670,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
{
// cheating attempt
if(count < 1) count = 1;
-
+
// cheating attempt
if(slot > MAX_BAG_SIZE && slot !=NULL_SLOT)
return false;
@@ -17794,7 +17794,12 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
{
if( bagguid == pBag->GetGUID() )
{
- if(slot < pBag->GetBagSlot() && !pBag->GetItemByPos(slot))
+ // slot is counted from 0 but BagSize from 1
+ if(slot+1 > pBag->GetBagSize())
+ {
+ sLog.outDebug("CHEATING ATTEMPT slot > bagSize in BuyItemFromVendor playerGUID: "I64FMT" name: %s slot: %u", GetGUID(), GetName(), slot);
+ return false;
+ }
bag = i;
break;
}