What I may have figured out, is that apparently my struct is treated as a pointer when I assign it to a PlayerInfo, even if that PlayerInfo is a struct I declared in that function, along with the UserCmd; it's a Pointer< NativeStruct<UserCmd> >, but PlayerInfo wants a NativeStruct<UserCmd>.
The usual way - just plain assigning cmd to possessed.player.cmd - would not crash the compiler; it would crash the runtime, accessing a NULL pointer somewhere in the original C code. If this in qzdoom.pk3/zscript/shared/player.txt:
Code: Select all
native @UserCmd cmd;
I mean, I could just lazily copy parts of the player code for movement (TweakMove, etc), and make it work from such, but I don't want to, because it would be a bit redundant. Is there any other way? Preferably using UserCMDs?