I have a pointer that is valid on only certain screens of a game. It doesn't go NULL but actually contains data, just junk data that doesn't evaluate to the rest of my pointers.
- Code: Select all
players->local->myplayer->goodie;
The 'goodie' is an integer. When I am in certain screens ie the menu screen, this is '0'
When I leave the menu 'players' is valid but 'local' dies and turns to garbage thus breaking the link to 'goodie'.
I can't check for NULL since it isn't NULL. IsBadReadPtr doesn't seem to evaluate the whole 'tree' either. Anyone have a good method to check from base all the way to desired variable?