Google-Code-Fork / tibiaapi

Automatically exported from code.google.com/p/tibiaapi
MIT License
0 stars 0 forks source link

Move() #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think an interesting add more information to Move(), which inform of 0-19
(Backpack) indicating the location be moved in toItem.Loc. 
Example:

        public bool Move(Objects.Item toItem, int i)
        {
                toItem.Loc.position = Convert.ToByte(i);
                toItem.Loc.stackOrder = Convert.ToByte(i);
                return client.Send(Packets.ItemMovePacket.Create(
                    client, loc, id, loc.ToBytes()[4], toItem.Loc, count));
        }

Original issue reported on code.google.com by conflict...@gtempaccount.com on 18 Jul 2008 at 2:11

GoogleCodeExporter commented 9 years ago
Couple things:

1. There is no stack order for the To item
2. If you get an item from a container, position will already be set, and if 
you use
that item as the "ToItem" (or any item where the ItemLocationType is Container) 
the
packet will include the position.

So, in short, this isn't needed, the Move function already does what you want 
it to.

Original comment by ian320 on 18 Jul 2008 at 3:09

GoogleCodeExporter commented 9 years ago
the problem is when you try to move an item to a backpack, only that the 
position 0 
is another container, anger that item to another container

Original comment by conflict...@gtempaccount.com on 18 Jul 2008 at 3:23

GoogleCodeExporter commented 9 years ago
I am not sure I understand what you mean.

Original comment by ian320 on 19 Jul 2008 at 1:38