diff api/Objects/Stats.cs @ 181:8c6f55d289b0

Fixes #200: Stats names should be case-insensitive * ToLower() all stat names/IDs so that they are case-insensitive
author IBBoard <dev@ibboard.co.uk>
date Sat, 24 Oct 2009 15:18:00 +0000
parents 5145b7c61ae0
children ece26f6a62f3
line wrap: on
line diff
--- a/api/Objects/Stats.cs	Sat Oct 24 15:16:35 2009 +0000
+++ b/api/Objects/Stats.cs	Sat Oct 24 15:18:00 2009 +0000
@@ -35,7 +35,7 @@
 
 		public void SetStatValue(string statName, string statValue)
 		{
-			StatSlot slot = sysStats[statName];
+			StatSlot slot = sysStats[statName.ToLower()];
 
 			if (slot!=null)
 			{
@@ -52,7 +52,7 @@
 		{
 			get
 			{
-				StatSlot slot = sysStats[id];
+				StatSlot slot = sysStats[id.ToLower()];
 				int pos = sysStats.GetStatSlotPosition(slot);
 				Stat stat = null;
 				
@@ -86,7 +86,7 @@
 
 		public string GetStatValue(string id)
 		{
-			return this[id].SlotValueString;
+			return this[id.ToLower()].SlotValueString;
 		}
 		
 		public int StatCount