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.)
[ZScript] Empty dynarrays aren't handled correctly in saves
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.
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.
- 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
- Graf Zahl
- 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
It indeed skips empty arrays. On the top level this makes sense but obviously not if the array is an array element itself.