oops hash codes can be negative, account for that

From: Sean Dague <sdague@gmail.com>
This commit is contained in:
Sean Dague
2009-01-19 21:38:31 +00:00
parent c81395593d
commit 280ba00c68

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)];
}
}
}