diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 0404422..04df35a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -295,38 +295,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
295 | return; | 295 | return; |
296 | } | 296 | } |
297 | 297 | ||
298 | m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString(), this, delegate(string id, object sender, AssetBase asset) | 298 | AssetBase asset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); |
299 | { | 299 | if (null == asset) |
300 | if (null == asset) | 300 | { |
301 | { | 301 | string msg = String.Format("asset ID {0} could not be found", item.AssetID); |
302 | string msg = String.Format("asset ID {0} could not be found", item.AssetID); | 302 | StoreScriptError(item.ItemID, msg); |
303 | StoreScriptError(item.ItemID, msg); | 303 | m_log.ErrorFormat( |
304 | m_log.ErrorFormat( | 304 | "[PRIM INVENTORY]: " + |
305 | "[PRIM INVENTORY]: " + | 305 | "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", |
306 | "Couldn't start script {0}, {1} at {2} in {3} since {4}", | 306 | item.Name, item.ItemID, m_part.AbsolutePosition, |
307 | item.Name, item.ItemID, m_part.AbsolutePosition, | 307 | m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); |
308 | m_part.ParentGroup.Scene.RegionInfo.RegionName, msg); | 308 | } |
309 | } | 309 | else |
310 | else | 310 | { |
311 | { | 311 | if (m_part.ParentGroup.m_savedScriptState != null) |
312 | if (m_part.ParentGroup.m_savedScriptState != null) | 312 | RestoreSavedScriptState(item.OldItemID, item.ItemID); |
313 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | 313 | |
314 | m_items.LockItemsForWrite(true); | 314 | lock (m_items) |
315 | m_items[item.ItemID].PermsMask = 0; | 315 | { |
316 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 316 | m_items[item.ItemID].PermsMask = 0; |
317 | m_items.LockItemsForWrite(false); | 317 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
318 | string script = Utils.BytesToString(asset.Data); | 318 | } |
319 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | 319 | |
320 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | 320 | string script = Utils.BytesToString(asset.Data); |
321 | StoreScriptErrors(item.ItemID, null); | 321 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( |
322 | m_part.ParentGroup.AddActiveScriptCount(1); | 322 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); |
323 | m_part.ScheduleFullUpdate(); | 323 | StoreScriptErrors(item.ItemID, null); |
324 | } | 324 | m_part.ParentGroup.AddActiveScriptCount(1); |
325 | }); | 325 | m_part.ScheduleFullUpdate(); |
326 | } | 326 | } |
327 | else | ||
328 | { | ||
329 | StoreScriptError(item.ItemID, "scripts disabled"); | ||
330 | } | 327 | } |
331 | } | 328 | } |
332 | 329 | ||