Hi I'm having trouble with a seemingly very odd bug in my code.
In my AI code, I have a Tlist representing lists of goals for the AI to perform. Occasionally, and seemingly randomly (every time I build it occurs at a different time - perhaps due to the random seed being different) the game gives me an 'attempt to access null object / method' error when I call:
If goallist.Contains(CONSTANT)
In the debugger, I can see that the right value is passed (a constant representing a goal) in the AI method which calls contains, and the list both exists and contains object[s]. However, the odd thing is that the link being tested in the Contains() method appears to be a TImageFont, and has a null value!
Any ideas at all about this, as I'm really scratching my head. It's being passed the correct stuff, but it thinks the object's value is null.
In my AI code, I have a Tlist representing lists of goals for the AI to perform. Occasionally, and seemingly randomly (every time I build it occurs at a different time - perhaps due to the random seed being different) the game gives me an 'attempt to access null object / method' error when I call:
If goallist.Contains(CONSTANT)
In the debugger, I can see that the right value is passed (a constant representing a goal) in the AI method which calls contains, and the list both exists and contains object[s]. However, the odd thing is that the link being tested in the Contains() method appears to be a TImageFont, and has a null value!
Any ideas at all about this, as I'm really scratching my head. It's being passed the correct stuff, but it thinks the object's value is null.