Here is an example to reproduce this. Attached is a file with the following ZScript code:
Code: Select all
class Test : Inventory
{
private voidptr _test;
}
Code: Select all
Save failed
Attempt to save pointer to unhandled type Type
Moderator: GZDoom Developers
Code: Select all
class Test : Inventory
{
private voidptr _test;
}
Code: Select all
Save failed
Attempt to save pointer to unhandled type Type
I guess this restriction should apply to non-native classes so as not to confuse the modder. Because it sure as hell confused me so I even had to bisect my mod repository to find out where things went south.If it is not possible to resolve at run-time the type of the object a "voidptr" points to, then declaring non-transient fields of type "voidptr" probably shouldn't be allowed.
Why not make them implicitly transient, then? Because it seems that in every case when a user-defined class has them, it will always make saving fail. I see in the compiler code that it can distinguish between gzdoom.pk3's scripts and third-party scripts, so it should be possible to implement this only for the latter. Or is it not going to work for some other reason?Graf Zahl wrote:The compiler cannot determine that the code is invalid. In fact, it is perfectly valid to define such objects - the caveat is that pointers to such a type have to be explicitly declared as transient.
Player701 wrote:I guess this restriction should not apply to all classes, since not every class can be serialized. (e.g., AFAIK, UI classes are not serialized, am I right?)