Conversion tool that is able to convert from the game binary formats (.pmx) to the middle formats (.pix) in Euro Truck Simulator 2 & American Truck Simulator.
In ATS 1.38 there is a prefab which causes the converter to crash: /prefab/corners/sidewalk_fork_2-2_country_2-1_country_r.ppd
It crashes at src/prefab/prefab.cpp:706
TerrainPointVariant data = m_terrainPointVariants[node->m_variantIdx + j];
because for some reason this prefab has node->m_variantCount set to 2 (for both nodes) but there are no ppd_terrain_point_variant_t blocks in the file - header->m_terrain_point_variant_count == 0 and header->m_terrain_point_variant_offset == header->m_map_point_offset.
I made a simple check to see if node->m_variantIdx + node->m_variantCount > m_terrainPointVariants.size() and if it is I'm printing a warning message and setting variant count to 0 so that the file can still be converted but without terrain point variants.
After converting the file with this version it loads in blender but there are some error messages (unrelated to terrain point variants I think):
ERROR SUMMARY:
================
> Map connection out of range: (0, 769)
> Map connection out of range: (1, 770)
> Map connection out of range: (1, -1064304636)
> Map connection out of range: (1, -1041235969)
================
it seems there are wrong values for Neighbours in pip file:
In ATS 1.38 there is a prefab which causes the converter to crash: /prefab/corners/sidewalk_fork_2-2_country_2-1_country_r.ppd
It crashes at src/prefab/prefab.cpp:706
because for some reason this prefab has
node->m_variantCount
set to 2 (for both nodes) but there are noppd_terrain_point_variant_t
blocks in the file -header->m_terrain_point_variant_count == 0
andheader->m_terrain_point_variant_offset == header->m_map_point_offset
.I made a simple check to see if
node->m_variantIdx + node->m_variantCount > m_terrainPointVariants.size()
and if it is I'm printing a warning message and setting variant count to 0 so that the file can still be converted but without terrain point variants.After converting the file with this version it loads in blender but there are some error messages (unrelated to terrain point variants I think):
it seems there are wrong values for
Neighbours
in pip file:but that's what is in the ppd file - this only reassured me that this ppd file is broken.