[8897] More stricted checks for store operations.

* Use stricted definition valid pos for expected explicit pos cases
* Prevent attempts add bag to self at autostore.
This commit is contained in:
VladimirMangos 2009-11-30 16:50:51 +03:00
parent d48ce8b717
commit 5186046c5e
5 changed files with 20 additions and 18 deletions

View file

@ -2011,10 +2011,11 @@ bool ChatHandler::HandleItemMoveCommand(const char* args)
if(srcslot==dstslot)
return true;
if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,srcslot))
if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcslot, true))
return false;
if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,dstslot))
// can be autostore pos
if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,dstslot, false))
return false;
uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcslot);