Page 1 of 1

Problem function<--RESOLVED-->Tnk-->Skydereign

PostPosted: Sat Apr 04, 2009 12:37 pm
by equinox
HI at ALL,

I do not understand how to fix it. Any ideas?

Tnk1000.

Re: Problem function

PostPosted: Sat Apr 04, 2009 1:40 pm
by Bee-Ant
What if this...
Code: Select all
void CALC(int p)
{
   if(strcmp(NONE[NP],"Leone")==0)
   {
      switch(p)
      {
         case 0;
         return 10;
         break;
      }
   }
}

Re: Problem function

PostPosted: Sat Apr 04, 2009 4:31 pm
by skydereign
No, the error is caused by your use return. Return automatically exits the code, so you don't need to use break. Typically people will still use a break, and have the return at the end of the function call. If you fix that, it should work.
http://game-editor.com/forum/viewtopic.php?f=5&t=6542

Re: Problem function

PostPosted: Sat Apr 04, 2009 5:04 pm
by equinox
Perfect !!!

Tnk1000 for help me.