Page 1 of 1

warehouse- and inventory-ItemContainer contain the same item

Posted: Sat Mar 23, 2013 3:27 pm
by Hyrelius
If you want to receive support we need this info to help you properly.
ยป Find Revision
L2J Revision 5759:5828M
L2JDP Revision 9397:9413

I'm having trouble with ItemContainer-behavior.
Problem occurs when:
1. Create/use an object of L2PcInstance (e.g. character).
2. Call "character.getInventory().getItems" and inspect the L2ItemInstance-objects
3. Call "character.getWarehouse().getItems" and inspect the L2ItemInstance-objects
4. Transfer an item from warehouse to inventory
5. Have another look at the L2ItemInstances of the warehouse and inventory of the given L2PcInstance.

What you will see, is, that even though you have transferred a certain item from your warehouse to your inventory, you can still find the item in the warehouse-ItemContainer AS WELL, which leads to problems if you're using these ItemContainers for a script (what I do).

In my opinion the item should be removed from the warehouse-ItemContainer once it's added to the inventory-ItemContainer. Further more the "LocationSlot" should be set (this slot is NOT set on the newly transferred item until you logout? because then you can see the slot in the database).

Edit: I've figured out, that if/when you use "updateDatabase()" it seems to remove the item, which has been transferred from the warehouse to the owner's inventory, from the list (and hence it fixes my problem), but I doubt that it should be like this.