VPK Search Paths
Tuesday, March 5, 2013
Today I fixed the VPK search paths issue.
The issue was that when you were opening folders to show the game content in the spawnmenu.. previously all VPK content showed in each folder. That was obviously wrong.
This was happening because the VPK stuff internally has no sense of search paths. They get searched all the time no matter what search path we're specifying.
So we add this code to the VPK class..
Then we can set what search path it's meant to be on. In GMod we set up a new search path for each mounted content ( called "tf", "dods", "portal2" etc) so we can search only that mounted content. But the path is also added to "GAME" so that the content will actually get loaded. The code above isn't really flexible but it serves our purposes.
The anywhere that VPK files are actually accessed we do a quick check using the provided PathID.
And now we have searchable VPKs working properly!
Portal 2 content is back and all working. Although there are some crashes due to them all being a newer model format and me having hacked the shit out of stuff to get them working in the first place.. but I've fixed a couple of crashes so hopefully 99% of them will work without crashing.