Hey guys...I'm having some trouble with my
Code:
public static string[] ShuffleGuildScores()
{
try
{
string[] ret = new string[5];
DictionaryEntry[] Vals = new DictionaryEntry[5];
for (sbyte i = 0; i < 5; i++)
{
Vals[i] = new DictionaryEntry();
Vals[i].Key = (ushort)0;
Vals[i].Value = (uint)0;
}
foreach (DictionaryEntry Score in Scores)
{
sbyte Pos = -1;
for (sbyte i = 0; i < 5; i++)
{
[B][COLOR="Red"] if (((GWScore)Score.Value).Score > (uint)Vals[i].Value)[/COLOR][/B]
{
Pos = i;
break;
}
}
if (Pos == -1)
continue;
for (sbyte i = 4; i > Pos; i--)
Vals[i] = Vals[i - 1];
Vals[Pos] = Score;
}
for (sbyte i = 0; i < 5; i++)
{
if ((ushort)Vals[i].Key == 0)
{
ret[i] = "";
continue;
}
Features.Guild eGuild = (Features.Guild)Features.Guilds.AllTheGuilds[(ushort)Vals[i].Key];
ret[i] = "No " + (i + 1).ToString() + ": " + eGuild.GuildName + "(" + ((GWScore)Vals[i].Value).Score + ")";
}
return ret;
}
catch (Exception Exc) { Program.WriteLine(Exc); Scores = new Hashtable(); return null; }
}
It doesn't let more than 1 score to show up and they always reset otherwise it would fk up the guildwars
the problem shows at the red line...
anyone can help me with this?