superantimonitor
New member
I found a weird error while scripting, non-fatal but i keep wondering why.
This doesn't work
The log says:
Script error: data/scripts/updated.c, line 78: Unknown error 'int' (in production 20)
int px = getentityproperty(p_ent,"x");
But this does
I have noticed that i can't declare a variable after a return;, it doesn't matter if i put braces around, there must be something else between a return and a variable declaring.
Of course i could move all declarations on top, it's only that i find this weird.
Have you seen this too?
This doesn't work
Code:
int dummy = 0;
if(!something) return;
int px = getentityproperty(p_ent,"x");
The log says:
Script error: data/scripts/updated.c, line 78: Unknown error 'int' (in production 20)
int px = getentityproperty(p_ent,"x");
But this does
Code:
int dummy = 0;
if(!something) return;
dummy = 1;
int px = getentityproperty(p_ent,"x");
I have noticed that i can't declare a variable after a return;, it doesn't matter if i put braces around, there must be something else between a return and a variable declaring.
Of course i could move all declarations on top, it's only that i find this weird.
Have you seen this too?