[ZScript] Empty dynarrays aren't handled correctly in saves

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.
Post Reply
User avatar
phantombeta
Posts: 2084
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

[ZScript] Empty dynarrays aren't handled correctly in saves

Post by phantombeta »

Arrays of dynamic arrays ("Array<{type}> a [{count}]") don't get saved properly if any of the dynamic arrays is empty.
This can be seen in the example WAD.
Example PK3.

You can test it by binding the "Weap assign menu" key, then giving all weapons and assigning some weapons to slots. If you want to see it happen very clearly, leave an empty column between two columns with weapons assigned.
After you save and load the save, the columns will be shifted, and any empty columns between columns with weapons will be missing.

(Note: The first column of weapons will actually be straight up missing when you reload. This is because the first column in the menu is actually index 1 of the array of dynarrays, meaning index 0 will always be empty.)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ZScript] Empty dynarrays aren't handled correctly in sa

Post by Graf Zahl »

It indeed skips empty arrays. On the top level this makes sense but obviously not if the array is an array element itself.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ZScript] Empty dynarrays aren't handled correctly in sa

Post by Graf Zahl »

fixed
Post Reply

Return to “Closed Bugs [GZDoom]”