@ -1444,11 +1444,25 @@ public class ClientMessagePump implements NetMsgHandler {
@@ -1444,11 +1444,25 @@ public class ClientMessagePump implements NetMsgHandler {
return ;
}
buy = Item . createItemForPlayer ( sourcePlayer , ib ) ;
if ( buy ! = null ) {
me . transferEnchants ( buy ) ;
itemMan . addItemToInventory ( buy ) ;
//itemMan.updateInventory();
if ( ib . getType ( ) . ordinal ( ) = = Enum . ItemType . RESOURCE . ordinal ( ) ) {
int count = 1 ;
for ( Item item : itemMan . getInventory ( ) ) {
if ( item . getItemBaseID ( ) = = ib . getUUID ( ) ) {
if ( item . getNumOfItems ( ) + count < = Warehouse . getMaxResources ( ) . get ( ib . getUUID ( ) ) ) {
count + = item . getNumOfItems ( ) ;
itemMan . delete ( item ) ;
}
}
}
Item resource = new MobLoot ( sourcePlayer , ib , count , false ) . promoteToItem ( sourcePlayer ) ;
itemMan . addItemToInventory ( resource ) ;
} else {
buy = Item . createItemForPlayer ( sourcePlayer , ib ) ;
if ( buy ! = null ) {
me . transferEnchants ( buy ) ;
itemMan . addItemToInventory ( buy ) ;
//itemMan.updateInventory();
}
}
}
}