map_properties: maps/zbSkyCraft.map: Error(Df(Df(TooShort)))
def- opened this issue · 4 comments
maps/zbSkyCraft.map: Error(Df(Df(TooShort)))
This is due to m_Version of layer # 31 having a value of 322. Here's the struct in DDNet repo: https://github.com/ddnet/ddnet/blob/master/src/game/mapitems.h#L302.
We use version to decide whether the structure should contain m_aName
field. DDNet does this by shifting the rest of the fields when m_Version <= 2
: https://github.com/ddnet/ddnet/blob/master/src/game/layers.cpp#L69-L104.
libtw2 does something similar, but only distinguishes values of 2 and 3 (also possibly 0 and 1), failing for other values: https://github.com/heinrich5991/libtw2/blob/master/map/src/format.rs#L244-L246.
There isn't a separate error for this situation at the moment so it gets incorrectly attributed to the layer buffer being too short.
Since apparently we don't encounter this error often, most of the maps must have values up to 3. However, we could make libtw2 behavior consistent with DDNet and just treat all versions higher than 2 equally.
This would also remove the need to improve error reporting - we'd remove this error situation completely.
Thanks for investigating.
Oh, I've just noticed that all this time I've been investigating the map from #15. Sorry for that, I've reposted my comment there.
ERROR:datafile::raw: file is not long enough, wanted 154179
.../zbSkyCraft.map: Df(Df(TooShort))
I think this map may be legitimately corrupted. I can't get the editor to open it.