remove redundant code

avinationmerge
UbitUmarov 2014-09-21 22:43:17 +01:00
parent 640f3f3074
commit 51ec2d83ac
1 changed files with 7 additions and 20 deletions

View File

@ -505,35 +505,22 @@ namespace OpenSim.Region.Framework.Scenes
private void CreateScriptInstanceInternal(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource) private void CreateScriptInstanceInternal(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{ {
m_items.LockItemsForRead(true); m_items.LockItemsForRead(true);
if (m_items.ContainsKey(itemId)) if (m_items.ContainsKey(itemId))
{ {
if (m_items.ContainsKey(itemId)) m_items.LockItemsForRead(false);
{ CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
m_items.LockItemsForRead(false);
CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
}
else
{
m_items.LockItemsForRead(false);
string msg = String.Format("couldn't be found for prim {0}, {1} at {2} in {3}", m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
StoreScriptError(itemId, msg);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Couldn't start script with ID {0} since it {1}", itemId, msg);
}
} }
else else
{ {
m_items.LockItemsForRead(false); m_items.LockItemsForRead(false);
string msg = String.Format("couldn't be found for prim {0}, {1}", m_part.Name, m_part.UUID); string msg = String.Format("couldn't be found for prim {0}, {1} at {2} in {3}", m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
StoreScriptError(itemId, msg); StoreScriptError(itemId, msg);
m_log.ErrorFormat( m_log.ErrorFormat(
"[PRIM INVENTORY]: Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", "[PRIM INVENTORY]: " +
itemId, m_part.Name, m_part.UUID, "Couldn't start script with ID {0} since it {1}", itemId, msg);
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
} }
} }
/// <summary> /// <summary>