Problem with a few accounts

07/20/2011 22:35 Golden11#1
I've observed this problem over the course of 2 days. Whenever certain players login I get this error on the .exe thing. All of these players also experienced a common problem, they lost items upon logging. I believe its because they have 41+ items in their inventory, but i'm not the best at this. It also crashes the login. Can anyone pinpoint the problem? If so, can you find a solution as well? Thanks. And yes this is the conquer-sx source.


Heres the error.
[Only registered and activated users can see links. Click Here To Register...]
07/20/2011 22:40 BaussHacker#2
Code:
If (!Somecollection.Contains(Whateveryouwanttoadd))
    Somecollection.Add(Whateveryouwanttoadd);
07/20/2011 22:45 Golden11#3
"I'm not the best at this" Where do I put that and what would I add?

#Fail on my part.
07/20/2011 22:50 BaussHacker#4
At the line giving the exception.

The reason you get the exception, it's because you're trying to add something to a collection, that's already added.

Example could be:
Code:
//this will give an exception:
void AddItemToBag(Item item)
{
    this.Bag.Items.Add(item);
}

//This will avoid it.
void AddItemToBag(Item item)
{
if (!this.Bag.Items.Contains(item))
    this.Bag.Items.Add(item);
}