Fixed regions not working.

This commit is contained in:
Lucas Nicodemus 2011-07-22 16:15:34 -06:00
parent 15af989826
commit 3291195af8

View file

@ -234,6 +234,10 @@ namespace TShockAPI.DB
{ {
for (int i = 0; i < SplitIDs.Length; i++) for (int i = 0; i < SplitIDs.Length; i++)
{ {
if (SplitIDs.Length == 0)
{
break;
}
r.RegionAllowedIDs[i] = Convert.ToInt32(SplitIDs[i]); r.RegionAllowedIDs[i] = Convert.ToInt32(SplitIDs[i]);
} }
} catch (Exception e) } catch (Exception e)
@ -241,7 +245,7 @@ namespace TShockAPI.DB
Log.Error("Your database contains invalid UserIDs (they should be ints)."); Log.Error("Your database contains invalid UserIDs (they should be ints).");
Log.Error("A lot of things will fail because of this. You must manually delete and re-create the allowed field."); Log.Error("A lot of things will fail because of this. You must manually delete and re-create the allowed field.");
Log.Error(e.Message); Log.Error(e.Message);
continue; Log.Error(e.StackTrace);
} }
Regions.Add(r); Regions.Add(r);