aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrz <none@none>2009-06-26 18:20:42 +0200
committerkrz <none@none>2009-06-26 18:20:42 +0200
commita494b0436c5bdcbcff4d89c7bdd63060fd09133b (patch)
treef2ab6e26ab7d15f7c48240b75b390620971c4f2e
parent8334693fe73f0d63f0738028a5a2365554ea97b3 (diff)
Fix exploit in BuyItemFromVendor
--HG-- branch : trunk
-rw-r--r--src/game/Player.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 525e1448ce8..54e35a28466 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17145,6 +17145,15 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
SendBuyError( BUY_ERR_CANT_FIND_ITEM, NULL, item, 0);
return false;
}
+ else
+ {
+ if(slot > pProto->ContainerSlots)
+ {
+ sLog.outDebug("CHEATING ATTEMPT slot > pProto->ContainerSlots in BuyItemFromVendor playerGUID: "I64FMT" name: %s slot: %u", GetGUID(), GetName(), slot);
+ return false;
+ }
+ }
+
Creature *pCreature = ObjectAccessor::GetNPCIfCanInteractWith(*this, vendorguid,UNIT_NPC_FLAG_VENDOR);
if (!pCreature)