aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-22 22:13:57 +0000
committerJustin Clark-Casey (justincc)2011-11-22 22:13:57 +0000
commitb0fe0464af9a11dda184d3613eca734cd8c9f21e (patch)
tree27a8a50451c139f954d86d4348ca6e10a552c34e /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
parentslightly simplify OdeScene.Simulate() by removing bool processtaints, since w... (diff)
downloadopensim-SC_OLD-b0fe0464af9a11dda184d3613eca734cd8c9f21e.zip
opensim-SC_OLD-b0fe0464af9a11dda184d3613eca734cd8c9f21e.tar.gz
opensim-SC_OLD-b0fe0464af9a11dda184d3613eca734cd8c9f21e.tar.bz2
opensim-SC_OLD-b0fe0464af9a11dda184d3613eca734cd8c9f21e.tar.xz
Stop an exception being thrown and a teleport/border cross failing if the desintation sim has no active script engines.
This involves getting IScene.RequestModuleInterfaces() to return an empty array (as was stated in the method doc) rather than an array containing one null entry. Callers adjusted to stop checking for the list reference being null (which never happened anyway)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 9446741..d80944b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -232,8 +232,6 @@ namespace OpenSim.Region.Framework.Scenes
232 ArrayList ret = new ArrayList(); 232 ArrayList ret = new ArrayList();
233 233
234 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 234 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
235 if (engines == null) // No engine at all
236 return ret;
237 235
238 foreach (IScriptModule e in engines) 236 foreach (IScriptModule e in engines)
239 { 237 {
@@ -329,7 +327,7 @@ namespace OpenSim.Region.Framework.Scenes
329 private void RestoreSavedScriptState(UUID oldID, UUID newID) 327 private void RestoreSavedScriptState(UUID oldID, UUID newID)
330 { 328 {
331 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 329 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
332 if (engines == null) // No engine at all 330 if (engines.Length == 0) // No engine at all
333 return; 331 return;
334 332
335 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) 333 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID))
@@ -369,6 +367,7 @@ namespace OpenSim.Region.Framework.Scenes
369 367
370 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; 368 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
371 } 369 }
370
372 foreach (IScriptModule e in engines) 371 foreach (IScriptModule e in engines)
373 { 372 {
374 if (e != null) 373 if (e != null)
@@ -377,6 +376,7 @@ namespace OpenSim.Region.Framework.Scenes
377 break; 376 break;
378 } 377 }
379 } 378 }
379
380 m_part.ParentGroup.m_savedScriptState.Remove(oldID); 380 m_part.ParentGroup.m_savedScriptState.Remove(oldID);
381 } 381 }
382 } 382 }
@@ -1129,7 +1129,7 @@ namespace OpenSim.Region.Framework.Scenes
1129 1129
1130 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 1130 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
1131 1131
1132 if (engines == null) // No engine at all 1132 if (engines.Length == 0) // No engine at all
1133 return ret; 1133 return ret;
1134 1134
1135 List<TaskInventoryItem> scripts = GetInventoryScripts(); 1135 List<TaskInventoryItem> scripts = GetInventoryScripts();
@@ -1157,7 +1157,7 @@ namespace OpenSim.Region.Framework.Scenes
1157 public void ResumeScripts() 1157 public void ResumeScripts()
1158 { 1158 {
1159 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 1159 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
1160 if (engines == null) 1160 if (engines.Length == 0)
1161 return; 1161 return;
1162 1162
1163 List<TaskInventoryItem> scripts = GetInventoryScripts(); 1163 List<TaskInventoryItem> scripts = GetInventoryScripts();