yo!
hmmm i'm just learning more with my current patched source but... there is something bothering me...
i've tried many times and the problem stay the same....
when i call the void for the second or third time... the iten is not removed anymore .... oO
those are my voids for remove and check to contains an item :
//Don't say you haven't added database removal and the itenusage packet... they're at my Inventory class ^^
if somene saw something wrong inside the codes.... i would like the help ^^
hmmm i'm just learning more with my current patched source but... there is something bothering me...
i've tried many times and the problem stay the same....
when i call the void for the second or third time... the iten is not removed anymore .... oO
those are my voids for remove and check to contains an item :
Code:
public static void RemoveItem(uint UID, ClientSocket CSocket)
{
Again:
try
{
CSocket.Client.Inventory.Remove(UID);
}
catch { Console.WriteLine("Error while removing UID " + UID); goto Again; }
}
public static void RemoveItem(uint ID, byte Times, ClientSocket CSocket)
{
byte ItemsFound = 0;
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item == null) continue;
if (ItemsFound == Times) break;
if (Item.ID == ID)
{
RemoveItem(Item.UID, CSocket);
ItemsFound++;
}
}
}
public static bool ContainsItem(uint ID, byte Times, ClientSocket CSocket)
{
byte Count = 0;
Struct.ItemInfo[] Inv = CSocket.Client.Inventory.Values;
foreach (Struct.ItemInfo Item in Inv)
if (Item != null)
if (Item.ID == ID)
Count++;
return (Count >= Times);
}
if somene saw something wrong inside the codes.... i would like the help ^^