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))
{
// region doesn't take it
ReInstantiateScripts(agent);
ResetFromTransit(agent.UUID);
return agent;
}
@ -1760,14 +1761,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected void ReInstantiateScripts(ScenePresence sp)
{
int i = 0;
sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
if (sp.InTransitScriptStates.Count > 0)
{
sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
sog.ResumeScripts();
});
sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
{
if (i < sp.InTransitScriptStates.Count)
{
sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
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