dupes in read_dir
Code:
this is producing dupes in the array, usually like 10 of each map. One time I noticed the first map was duped 4 times and then after that the rest were 8 times. Really strange. I ONLY is doing this on linux systems as far as I know, have not seen it occur in windows. Also does anyone have some code I could borrow/look at for sorting an array? |
hmm well: read_dir has a completly different implementation on GCC (thats our standard linux compiler) and on MSVC (our standard windows compiler). Ill check it.
Sorting an array: The probably simpliest (and slowest ;) ) way is bubble sort. The theory is something like this: Code:
for (i=0;i<max;++i) |
yeah i got the sorting worked out
http://forums.alliedmods.net/showthread.php?t=2756 as foir the dupes I added a little check to see if the last thing loaded is the same as the current and to just skip it. should fix the problem for now I hope. |
I just tried my little thing to look back and skip if its a dupe on a server with 375 maps and it hung for like a full minute when the server started.... i think the number of dupes that it pulls in just keeps growing and growing on linux, it works fine in windows still BTW
|
Re: dupes in read_dir
Try this:
Code:
|
omfg I'm dumb.... that works. I think I wrote that code when I was a nub and never noticed how dumb that was
|
Quote:
|
| All times are GMT -4. The time now is 14:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.