Quote:
Originally Posted by kinshi88
Read the error message carefully:
"Object reference not set to an instance of an object."
So you're using an object/variable when it hasn't been set to something.
Like if you're using a class called "Conquer", and you just define it like this:
Code:
public static Conquer MyCo;
Then you try to use it:
Code:
MyCo.Version += 10;
You'll get the same error, since MyCo == null.
So as @teroareboss1 pointed out, your Char is probably set to null, thus the error. =D
|
Damn you beat me to most of the explanation but the actual problem should be more related to setting the drop item. I had this for a short while when I was coding dis city drops.
If you are using a bunch of if/elseif statements to control what item id is dropped then you MUST make sure you have a backup plan.
Example:
Lets say you have a simple drop ratio on a specific map... if you had something along the lines of..
if(Calculation.PercentSuccess(50))
{
DropItem.ID = MeteorID;
}
else if (Calculation.PercentSuccess(50))
{
DropItem.ID = DragonBallId;
}
If you used something like that then you could theoretically NOT have anything set for the item ID causing this error. Yes you have two 50 percent chance things but just like flipping a coin... you can fail to flip heads twice in a row.
Basically check through your drop code and make sure that there isn't something in there that is being left empty. Chances are you are creating a structure for a new item and then filling in the blanks (what item ID, what +, what dura, etcetcetc) If one of those is left blank and not filled in then it can cause this kind of error to pop up as it seems to be.
I'd vote for that over character as it's happening in the drop item section of code. My other theory is that somewhere on the server a guard or something is killing monsters and the server isn't setup to control who the killer was and therefor is setting the "owner" of the item to something fucked up.... that seems less likely though.