some bug fix, new improved inventory manager (but still very bad but atleast you can give some items inside the bag)

This commit is contained in:
AlessandroCH
2025-03-09 16:24:46 +01:00
parent feb6922244
commit aedf2a885d
9 changed files with 258 additions and 49 deletions

View File

@@ -15,6 +15,11 @@ namespace Campofinale.Packets.Sc
public PacketScItemBagScopeModify(Player client, Item item) {
if (item == null)
{
SetData(ScMsgId.ScItemBagScopeModify, new ScItemBagScopeModify());
return;
}
ScItemBagScopeModify proto = new ScItemBagScopeModify()
{
Depot =

View File

@@ -19,10 +19,10 @@ namespace Campofinale.Packets.Sc
{
Bag = new()
{
GridLimit = 30,
GridLimit = client.inventoryManager.items.maxBagSize,
Grids =
{
new ScdItemGrid()
/*new ScdItemGrid()
{
GridIndex=0,
Count=1,
@@ -79,7 +79,7 @@ namespace Campofinale.Packets.Sc
InstId=300000000004,
},
}
}*/
}
},
FactoryDepot =
@@ -114,7 +114,17 @@ namespace Campofinale.Packets.Sc
proto.Bag = null;
}
proto.Depot.Add(i, new ScdItemDepot());
List<Item> items = client.inventoryManager.items.FindAll(item => item.ItemType == (ItemValuableDepotType)i);
foreach (var item in client.inventoryManager.items.bag)
{
proto.Bag.Grids.Add(new ScdItemGrid()
{
Count=item.Value.amount,
GridIndex=item.Key,
Id=item.Value.id,
Inst=item.Value.ToProto().Inst,
});
}
List<Item> items = client.inventoryManager.items.items.FindAll(item => item.ItemType == (ItemValuableDepotType)i);
items.ForEach(item =>
{
if (item.InstanceType())