Code snippet :
///////////// IN THE HEADER FILE ////////////////
struct MyStruct
{
import static attribute int SomeStaticValue;
};
//////////// In THE BODY ////////////////////////
int get_SomeStaticValue(this MyStruct*)
{
...
}
void set_SomeStaticValue(this MyStruct*, int value)
{
...
}
The compiler complains that
'MyStruct::get_SomeStaticValue' has the qualifiers '' here but 'static' elsewhere. See ./MyStruct.ash
If I change it like this :
static get_SomeStaticValue(this MyStruct*)
It still doesn't work.
Error:
Expected 'static', found 'this' instead
It should be "static Type", without a "pointer", and it's supported since AGS 3.4.0; the new compiler only forbids the incorrect syntax with a "this" pointer in this case.
int get_SomeStaticValue(static MyStruct)
{
}
EDIT: I think you can also do this instead (works with the new compiler):
static int MyStruct::get_SomeStaticValue()
{
}