I have a text object defined like this:
TEXT* ss_ledgendDeathsText = {
strings = 1;
string("suicides");
font = ss_smallFont;
layer = 62;
}
At some point, I suddenly get a crash, and I found out that it is due to "ledgendDeathsText" being NULL.
I checked, I never remove ledgendDeathsText anywhere, so why could it be NULL?
Even if another function would remove the object, would not the pointer still point to the same location?
Also, the text is still displayed on screen... so I suspect only the pointer gets set to 0. But how can that be, when the only things I ever do with ledgendDeathsText are the following (these lines are all over my code, not in one place):
ss_players[playerIndex].deathsTxt.pos_x = ss_ledgendDeathsText.pos_x;
ss_ledgendDeathsText.pos_x = ss_ledgendScoreText.pos_x - 30 - str_width((ss_ledgendDeathsText.pstring)[0],ss_ledgendDeathsText.font);
ss_ledgendDeathsText.pos_y = ss_ledgendPlayerText.pos_y;
ss_ledgendKillsText.pos_x = ss_ledgendDeathsText.pos_x - 30 - str_width((ss_ledgendKillsText.pstring)[0],ss_ledgendKillsText.font);
set(ss_ledgendDeathsText,SHOW);
reset(ss_ledgendDeathsText,SHOW);
As you can see, I never reassign ss_ledgendDeahsText anywhere in the code, neither do I create any pointer pointing at the ss_ledgendDeahsText pointer, so how could it EVER be 0?!
Last edited by Germanunkol; 07/07/11 12:55.