Page 2 of 2

Re: Messages from me to you and questions

PostPosted: Fri Nov 25, 2011 6:48 pm
by lcl
SuperSonic wrote:Just one problem, if you press backspace when there is nothing in the name, the game crashes Don't know why sorry about that.

Well, look at the gogo's code.
Now, what is 0 - 1? It's - 1. Is there array cell - 1? NO!
It's important to remember to use safety checks. Like here, let's make it check if the current array position is greater than 0.
Code: Select all
for(k=0;k<255;k++)
{
    if(TD_String.text[k]==0)
    {
        TD_String.text[k - 1 * (k > 0)]=0;
        break;
    }
}

Now, the code does nothing if you're at the position 0. :)
I wonder why hadn't GaG thought of this..

Anyway, that's it. :)

Re: Messages from me to you and questions

PostPosted: Fri Nov 25, 2011 7:51 pm
by Game A Gogo
probably because I made this code 3 years ago xD
I never really tested it that much either

Re: Messages from me to you and questions

PostPosted: Fri Nov 25, 2011 7:58 pm
by lcl
Game A Gogo wrote:probably because I made this code 3 years ago xD
I never really tested it that much either

Ah, I see :D

Re: Messages from me to you and questions

PostPosted: Sat Nov 26, 2011 3:32 pm
by SuperSonic
Thanks for explaining that lcl :D