From db151bcec7843162c6dadf92afb1cf59957df943 Mon Sep 17 00:00:00 2001 From: mingchen Date: Mon, 9 Jun 2008 15:20:08 +0000 Subject: *Fixed bug that caused failure when System.Console.Readline returns null (no stdin) *Fixed bug that would crash the simulator if there were two physics/meshing engines loaded with the same name. --- OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/Manager') diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index 6a71581..4927cc5 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs @@ -130,8 +130,11 @@ namespace OpenSim.Region.Physics.Manager IPhysicsPlugin plug = (IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Init(); - _PhysPlugins.Add(plug.GetName(), plug); - m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); + if(!_PhysPlugins.ContainsKey(plug.GetName())) + { + _PhysPlugins.Add(plug.GetName(), plug); + m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); + } } Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true); @@ -140,8 +143,11 @@ namespace OpenSim.Region.Physics.Manager { IMeshingPlugin plug = (IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - _MeshPlugins.Add(plug.GetName(), plug); - m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); + if(!_MeshPlugins.ContainsKey(plug.GetName())) + { + _MeshPlugins.Add(plug.GetName(), plug); + m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); + } } physTypeInterface = null; -- cgit v1.1