bulletsim
Diva Canto 2011-05-08 09:28:15 -07:00
parent d40e4562f2
commit 25809caaeb
1 changed files with 15 additions and 6 deletions

View File

@ -891,6 +891,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
{ {
// region doesn't take it // region doesn't take it
ReInstantiateScripts(agent);
ResetFromTransit(agent.UUID); ResetFromTransit(agent.UUID);
return agent; return agent;
} }
@ -1760,15 +1761,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected void ReInstantiateScripts(ScenePresence sp) protected void ReInstantiateScripts(ScenePresence sp)
{ {
int i = 0; int i = 0;
if (sp.InTransitScriptStates.Count > 0)
{
sp.Attachments.ForEach(delegate(SceneObjectGroup sog) sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
{
if (i < sp.InTransitScriptStates.Count)
{ {
sog.SetState(sp.InTransitScriptStates[i++], sp.Scene); sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0); sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
sog.ResumeScripts(); sog.ResumeScripts();
}
else
m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: InTransitScriptStates.Count={0} smaller than Attachments.Count={1}", sp.InTransitScriptStates.Count, sp.Attachments.Count);
}); });
sp.InTransitScriptStates.Clear(); sp.InTransitScriptStates.Clear();
} }
}
#endregion #endregion
} }