Correct minor bug regarding packing of estate bans

bullet-2.82
Diva Canto 2014-06-01 12:01:49 -07:00
parent 94d0ae0d91
commit 14a31c3e9b
1 changed files with 19 additions and 12 deletions

View File

@ -443,11 +443,15 @@ namespace OpenSim.Framework
} }
// EstateBans are special // EstateBans are special
if (EstateBans.Length > 0)
{
Dictionary<string, object> bans = new Dictionary<string, object>(); Dictionary<string, object> bans = new Dictionary<string, object>();
int i = 0; int i = 0;
foreach (EstateBan ban in EstateBans) foreach (EstateBan ban in EstateBans)
bans["ban" + i++] = ban.ToMap(); bans["ban" + i++] = ban.ToMap();
map["EstateBans"] = bans; map["EstateBans"] = bans;
}
return map; return map;
} }
@ -511,6 +515,8 @@ namespace OpenSim.Framework
} }
// EstateBans are special // EstateBans are special
if (map.ContainsKey("EstateBans"))
{
var banData = ((Dictionary<string, object>)map["EstateBans"]).Values; var banData = ((Dictionary<string, object>)map["EstateBans"]).Values;
EstateBan[] bans = new EstateBan[banData.Count]; EstateBan[] bans = new EstateBan[banData.Count];
int b = 0; int b = 0;
@ -520,4 +526,5 @@ namespace OpenSim.Framework
bansProperty.SetValue(this, bans, null); bansProperty.SetValue(this, bans, null);
} }
} }
}
} }