Originally Posted by
megazor
Secondly, in CoD2 you have to define all variables outside if statements.
Not true.
PHP Code:
if(a == b)
c = 1;
else
c = 2;
iprintln(c);
will not produce errors
but
PHP Code:
if(a == b)
c = 1;
else if(a != b)
c = 2;
iprintln(c);
will produce errors, for the script cannot be sure that it is actually called, although you can see it will.
also,
PHP Code:
somerandomcode();
return;
morerandomcode();
will give the "unreachable code" error.
PHP Code:
somerandomcode();
if(true)
return;
morerandomcode();
will not.
CoD2 is weird.