Attempt to save pointer to unhandled type NativeStruct<Font>

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Attempt to save pointer to unhandled type NativeStruct<Font>

Post by Marisa the Magician »

Reproduction: Load this mod, start a game, and use changemap to change to any other map. The game will fail to save with the message in the thread title.

I was told that font pointers were serializable, but apparently they aren't. I've been lied to, I want an explanation for this.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: Attempt to save pointer to unhandled type NativeStruct<F

Post by Gutawer »

Appears to just be a typo in InitImports.

Code: Select all

	auto fontstruct = NewStruct("FFont", nullptr, true);
	fontstruct->Size = sizeof(FFont);
	fontstruct->Align = alignof(FFont);
	NewPointer(fontstruct, false)->InstallHandlers(
		[](FSerializer &ar, const char *key, const void *addr)
		{
			ar(key, *(FFont **)addr);
		},
			[](FSerializer &ar, const char *key, void *addr)
		{
			Serialize<FFont>(ar, key, *(FFont **)addr, nullptr);
			return true;
		}
	);
The ZScript type is called Font so the first line should contain "Font" rather than "FFont".
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Attempt to save pointer to unhandled type NativeStruct<F

Post by Marisa the Magician »

Good lord, what just one tiny single-character typo can do...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49182
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Attempt to save pointer to unhandled type NativeStruct<F

Post by Graf Zahl »

I'm a bit puzzled why this didn't trigger earlier...
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Attempt to save pointer to unhandled type NativeStruct<F

Post by Marisa the Magician »

I think I can take most of the blame for that, in assuming this was intentional for so many years.

Return to “Closed Bugs [GZDoom]”