[7804] Allow swap and move by bag slots equipped ammopouch and quiver Author: Foks

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-10 14:30:04 -05:00
parent 40a8e6d3ab
commit 66c4b7b560
+9 -6
View File
@@ -9848,14 +9848,17 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
{ {
if( Item* pBag = GetItemByPos( INVENTORY_SLOT_BAG_0, i ) ) if( Item* pBag = GetItemByPos( INVENTORY_SLOT_BAG_0, i ) )
{ {
if( ItemPrototype const* pBagProto = pBag->GetProto() ) if( pBag != pItem )
{ {
if( pBagProto->Class==pProto->Class && (!swap || pBag->GetSlot() != eslot ) ) if( ItemPrototype const* pBagProto = pBag->GetProto() )
{ {
if(pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH) if( pBagProto->Class==pProto->Class && (!swap || pBag->GetSlot() != eslot ) )
return EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH; {
else if(pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH)
return EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER; return EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH;
else
return EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER;
}
} }
} }
} }