Then that is the reason it doesn't reverse.
The for loop change I suggested was based on the for loop variable i being the new TabPartyIndex value.
Dependant on how TabPartyIndex value is initialised may be what affects the result of that calculation inside the for loop.
I would suggest displaying that TabPartyIndex value alongside i each time it is set and see how it changes each cycle of the for loop.
If it results in the same value that i is inside the for loop then simply having TabPartyIndex set to i will correct your problem.
Then changing the for loop i value as I suggested should result in the expected value.
i = 1 > TabPartyIndex = i > party..TabPartyIndex > party1
i = 2 > TabPartyIndex = i > party..TabPartyIndex > party2
i = 3 > TabPartyIndex = i > party..TabPartyIndex > party3
i = 4 > TabPartyIndex = i > party..TabPartyIndex > party4
i = 5 > TabPartyIndex = i > party..TabPartyIndex > party5 > player
i = 5 > TabPartyIndex = i > party..TabPartyIndex > party5 > player
i = 4 > TabPartyIndex = i > party..TabPartyIndex > party4
i = 3 > TabPartyIndex = i > party..TabPartyIndex > party3
i = 2 > TabPartyIndex = i > party..TabPartyIndex > party2
i = 1 > TabPartyIndex = i > party..TabPartyIndex > party1
However, I always thought the player was party1, but I could be mistaken.
|