Digital Paint Discussion Board
Development => Bugs, Feature Requests, and Feedback => Topic started by: SoftCoder on December 26, 2009, 04:01:58 PM
-
While looking at the XReal project and figuring out what features need to be ported to that new quake engine (in order to make a new paintball clone), I noticed on my linux version of PB2 (v27) the maps list seems sorted ina random order as returned by the filesystem. For anyone who knows how to re-compile pb2 this can be fixed since you have access to the code which retrieves the maps list.. actually I changed it for all calls to getting file lists. To fix the map sort order edit qcommon/files.c as follows:
navigate the method:
char **FS_ListFiles (const char *findname, int *numfiles, unsigned musthave, unsigned canthave)
just above the last line (return list;) add this:
qsort (&list[0], nfiles, sizeof(char *), SortList);
Now navigate to the SortList method and change it to:
int SortList (const void *data1, const void *data2)
{
const char **a = (const char **)data1;
const char **b = (const char **)data2;
return strcmp(*a, *b);
}
Recompile and viola.. maps are sorted alphabetically again.
-
If anyone wants the compiled Linux version I zipped the binary (with the 3 shared libs created by the makefile)
http://www.soft-haus.com/games/paintball2.7z
-
Thanks - I'm not at home right now, so I can't add this change, but I'll try to remember to add it when I get home. I'm going to try editing it on the CVS from my laptop so I can just grab it before I do another release.
In the mean time, don't use modified client executables while playing online, as it's basically impossible to distinguish between legitimate modifications and cheats.