aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-27 16:37:29 +0200
committerQAston <none@none>2009-06-27 16:37:29 +0200
commite7e79ff8a402fe6279f6839c973e9db6549301b2 (patch)
treea03d3431824630c130c9446717b79ada33fa5454 /src/game/Player.cpp
parentda3569402d73d9a5ad8c67adc4000e43f0e0f5f5 (diff)
parent10ac2b73b88d84bd3005da69b145255a9f3aa2b9 (diff)
*Merge.
--HG-- branch : trunk
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;
}