mantis 8563: do not modify collection inside a loop on it a foreach on it
parent
aedaa32ddc
commit
78359c108d
|
@ -14192,16 +14192,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition).LandData;
|
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition).LandData;
|
||||||
if (land.OwnerID == m_host.OwnerID)
|
if (land.OwnerID == m_host.OwnerID && land.ParcelAccessList.Count > 0)
|
||||||
{
|
{
|
||||||
|
var todelete = new List<LandAccessEntry>();
|
||||||
foreach (LandAccessEntry entry in land.ParcelAccessList)
|
foreach (LandAccessEntry entry in land.ParcelAccessList)
|
||||||
{
|
{
|
||||||
if (entry.Flags == AccessList.Ban)
|
if (entry.Flags == AccessList.Ban)
|
||||||
{
|
todelete.Add(entry);
|
||||||
|
}
|
||||||
|
foreach (LandAccessEntry entry in todelete)
|
||||||
land.ParcelAccessList.Remove(entry);
|
land.ParcelAccessList.Remove(entry);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
ScriptSleep(m_sleepMsOnResetLandBanList);
|
ScriptSleep(m_sleepMsOnResetLandBanList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14209,16 +14210,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition).LandData;
|
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition).LandData;
|
||||||
if (land.OwnerID == m_host.OwnerID)
|
if (land.OwnerID == m_host.OwnerID && land.ParcelAccessList.Count > 0)
|
||||||
{
|
{
|
||||||
|
var todelete = new List<LandAccessEntry>();
|
||||||
foreach (LandAccessEntry entry in land.ParcelAccessList)
|
foreach (LandAccessEntry entry in land.ParcelAccessList)
|
||||||
{
|
{
|
||||||
if (entry.Flags == AccessList.Access)
|
if (entry.Flags == AccessList.Access)
|
||||||
{
|
todelete.Add(entry);
|
||||||
|
}
|
||||||
|
foreach (LandAccessEntry entry in todelete)
|
||||||
land.ParcelAccessList.Remove(entry);
|
land.ParcelAccessList.Remove(entry);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
ScriptSleep(m_sleepMsOnResetLandPassList);
|
ScriptSleep(m_sleepMsOnResetLandPassList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue