using enum struct as parameter when it's declaring
https://pastebin.com/U1fSY62u
Compiler says "error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')"
But i doubt it's an invalid expression. Is this a bug? or It's just an invalid expression?
What i tried to make was to check the data between two different PlayerTable to confirm it's identical or not.
like this,
https://pastebin.com/Bdw5axYu
Please use inline code blocks rather than linking to an external site.
I suspect this is the same issue as #303, the type doesn't exist until it has finished parsing.
enum struct PlayerTable2
{
int a[4];
void Test(PlayerTable2[1] test)
{
PrintToServer("%i", test[0].a[3]);
}
}
public void OnPluginStart()
{
PlayerTable2 x[1];
x[0].a[3] = 123;
x[0].Test(x);
}
One of SM discord user found that this expression worked as expected. Will I be able to use this expression even though it's not recommended?
Yes unfortunately that is the issue. I would like to fix this but I haven't nailed down how yet.
In the meantime, it is better to have a global method, like "ComparePlayers(Player a, Player b)".