Sorting bug
#4

Start by debugging your code, check what "array" contains after the first loop, debug the entries that get put into the array in the first loop, do approximately the same for the second loop.

By the way, you're sorting the array by territories won, the second loop will mix up the ids;
Код:
Ballas = 0 [1 Win]
Grove = 1 [0 Wins]
White = 2 [3 Wins]
After the sorting, the array will look like this;
Код:
White = 2 [3 Wins]
Ballas = 0 [1 Win]
Grove = 1 [0 Wins]
The second loop loops in order, 0 to MAX_FACTIONS, you're getting the array entry data by order;
PHP код:
for(new 0MAX_FACTIONSi++) {
    array[
i][E_TEAMNAME], array[i][E_TERRITORIESWON]

Array Entry 1 contains "Ballas" but because you're looping in order, it actually contains "Grove" - this is something you should fix.
Reply


Messages In This Thread
Sorting bug - by Kraeror - 15.11.2017, 17:43
Re: Sorting bug - by d1git - 15.11.2017, 18:32
Re: Sorting bug - by Kraeror - 15.11.2017, 18:53
Re: Sorting bug - by d1git - 15.11.2017, 19:06
Re: Sorting bug - by Kraeror - 15.11.2017, 19:14
Re: Sorting bug - by Kraeror - 15.11.2017, 19:58
Re: Sorting bug - by Andre02 - 15.11.2017, 21:17
Re: Sorting bug - by Kraeror - 16.11.2017, 11:42
Re: Sorting bug - by Kraeror - 16.11.2017, 12:27
Re: Sorting bug - by Kraeror - 16.11.2017, 16:16

Forum Jump:


Users browsing this thread: 1 Guest(s)