TTimo / GtkRadiant

The open source, cross platform level editor for idtech games
http://icculus.org/gtkradiant/
Other
591 stars 156 forks source link

q3map2 vfs does not reverse pak list upon dir initialization #614

Closed isRyven closed 6 years ago

isRyven commented 6 years ago

The game and Radiant load files in descending order, this way paks with higher number will always be loaded first, and first registered file with the same name always has precedence over the next one, when it comes to loading contents, but q3map2 loads files in ascending order instead! Could someone explain, is this by design?

The issue appears specifically here: https://github.com/TTimo/GtkRadiant/blob/2d91146b804be2d3176880d1a491dda96c4f92a7/tools/quake3/common/vfs.c#L198 While radiant's vfs does the sorting: https://github.com/TTimo/GtkRadiant/blob/2d91146b804be2d3176880d1a491dda96c4f92a7/plugins/vfspk3/vfs.cpp#L464

Now this might be not a big issue, but actually, this can bring to some really weird results.

Like here, where pak1.pk3 contains yellow walls, and pak2.pk3 red ones. Q3map2 uses pak1.pk3 to lit the surface, and game loads pak2.pk3 to display the texture!

wrong light

And Radiant loads pak2.pk3 as expected:

radiant

If we leave just pak2.pk3, we would get something we expect to get:

right light

TTimo commented 6 years ago

I thought q3map2 was already sorting correctly tbh. Patches welcome of course, but we should look to fix this.

isRyven commented 6 years ago

Alright i'll do it.