diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index f87d631..03fafed 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -718,7 +718,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
718 | // | 718 | // |
719 | try | 719 | try |
720 | { | 720 | { |
721 | instance.SaveState(); | 721 | if (instance.StatePersistedHere) |
722 | instance.SaveState(); | ||
722 | } | 723 | } |
723 | catch (Exception e) | 724 | catch (Exception e) |
724 | { | 725 | { |
@@ -830,7 +831,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
830 | lock (m_Scripts) | 831 | lock (m_Scripts) |
831 | { | 832 | { |
832 | foreach (IScriptInstance instance in m_Scripts.Values) | 833 | foreach (IScriptInstance instance in m_Scripts.Values) |
833 | instances.Add(instance); | 834 | { |
835 | if (instance.StatePersistedHere) | ||
836 | { | ||
837 | // m_log.DebugFormat( | ||
838 | // "[XEngine]: Adding script {0}.{1}, item UUID {2}, prim UUID {3} in {4} for state persistence", | ||
839 | // instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name); | ||
840 | |||
841 | instances.Add(instance); | ||
842 | } | ||
843 | } | ||
834 | } | 844 | } |
835 | 845 | ||
836 | foreach (IScriptInstance i in instances) | 846 | foreach (IScriptInstance i in instances) |
@@ -1457,7 +1467,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1457 | } | 1467 | } |
1458 | } | 1468 | } |
1459 | 1469 | ||
1460 | instance.RemoveState(); | 1470 | if (instance.StatePersistedHere) |
1471 | instance.RemoveState(); | ||
1472 | |||
1461 | instance.DestroyScriptInstance(); | 1473 | instance.DestroyScriptInstance(); |
1462 | 1474 | ||
1463 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 1475 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |