@joozey, I think your solution is the same that rei suggested, doesn't work eiter; However, I had already tried what Petra posted, and it works.
It does not work if the pointer is set on a function in a struct initialization like this:
SOMESTRUCT* myStruct =
{
myFunc = someFunc;
}
If I do this, calling the function per pointer results in a SYS error, no matter if I call it direclty or call a prototype function.
If I do this, however:
SOMESTRUCT* myStruct =
{
myFunc = NULL;
}
void main()
{
myStruct->myFunc = someFunc;
myStruct->myFunc();
}
then it works, just like in Petras suggestion.
The issue for me is that I wanted to use a struct full of function pointers for a somewhat OOP-approach; this isn't of much use however if I have to assign the functions to the pointers in another function instead of simply declaring an instance of the struct as I would declare a PANEL or an ENTITY.