lewa-j / Unity-Source-Tools

Plugin to import resources from the Source engine in Unity3D.
GNU General Public License v2.0
109 stars 22 forks source link

Half-Life 2 Beta BSP(v18) Array index error despite the map data loading #10

Closed Fronkln closed 5 years ago

Fronkln commented 5 years ago

ti = map.texinfosLump[face.texinfo];

This line generates an array index out of range error even though map data has been loaded perfectly.

Load: 501 TextureData's Load: 16544 Vertexes Load: 5602 TexInfos Load: 11773 Faces Load :45263 Edges Load :72666 SurfEdges Load: 86 Models Load: 43 DispInfos Load: 3019 DispVerts Load: 3 GameLumps Load :48153 TexDataStringData Load :876 TexDataStringsTable

The error happens when it starts loading the faces.

image

Map's texinfo seems to be loaded.

lewa-j commented 5 years ago

v18 face struct has additional 16 bytes in the beginning.

Fronkln commented 5 years ago

v18 face struct has additional 16 bytes in the beginning.

And is there any way to edit the code so it loads these 16 bytes? I'm afraid im not that knowledged in these type of stuff

lewa-j commented 5 years ago

Just commited. Try it now

Fronkln commented 5 years ago

Just commited. Try it now

Works perfectly, thank you!

image

Fronkln commented 5 years ago

Another quick question, is there a way to force nodraws to load in v19 and above? they simply do not load but i need them for NPC navigation because certain maps have the NPC's walk in invisible terrain