oops hash codes can be negative, account for that

From: Sean Dague <sdague@gmail.com>
0.6.3-post-fixes
Sean Dague 2009-01-19 21:38:31 +00:00
parent c81395593d
commit 280ba00c68
1 changed files with 2 additions and 1 deletions

View File

@ -123,7 +123,8 @@ namespace OpenSim.Framework.Console
private static ConsoleColor DeriveColor(string input)
{
return Colors[(input.ToUpper().GetHashCode() % Colors.Length)];
// it is important to do Abs, hash values can be negative
return Colors[(Math.Abs(input.ToUpper().GetHashCode()) % Colors.Length)];
}
}
}