diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index f1abd4b..5793cc9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -121,8 +121,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
121 | 121 | ||
122 | public bool Running { get; set; } | 122 | public bool Running { get; set; } |
123 | 123 | ||
124 | public bool Run { get; set; } | ||
125 | |||
126 | public bool Suspended | 124 | public bool Suspended |
127 | { | 125 | { |
128 | get { return m_Suspended; } | 126 | get { return m_Suspended; } |
@@ -218,7 +216,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
218 | m_postOnRez = postOnRez; | 216 | m_postOnRez = postOnRez; |
219 | m_AttachedAvatar = part.ParentGroup.AttachedAvatar; | 217 | m_AttachedAvatar = part.ParentGroup.AttachedAvatar; |
220 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; | 218 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; |
221 | Run = true; | ||
222 | 219 | ||
223 | if (part != null) | 220 | if (part != null) |
224 | { | 221 | { |
@@ -315,11 +312,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
315 | part.SetScriptEvents(ItemID, | 312 | part.SetScriptEvents(ItemID, |
316 | (int)m_Script.GetStateEventFlags(State)); | 313 | (int)m_Script.GetStateEventFlags(State)); |
317 | 314 | ||
318 | Running = false; | 315 | if (!Running) |
319 | |||
320 | if (ShuttingDown) | ||
321 | m_startOnInit = false; | 316 | m_startOnInit = false; |
322 | 317 | ||
318 | Running = false; | ||
319 | |||
323 | // we get new rez events on sim restart, too | 320 | // we get new rez events on sim restart, too |
324 | // but if there is state, then we fire the change | 321 | // but if there is state, then we fire the change |
325 | // event | 322 | // event |
@@ -355,15 +352,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
355 | 352 | ||
356 | public void Init() | 353 | public void Init() |
357 | { | 354 | { |
358 | if (!m_startOnInit) | 355 | if (ShuttingDown) |
359 | return; | 356 | return; |
360 | 357 | ||
361 | if (m_startedFromSavedState) | 358 | if (m_startedFromSavedState) |
362 | { | 359 | { |
363 | if (!Run) | 360 | if (m_startOnInit) |
364 | return; | 361 | Start(); |
365 | |||
366 | Start(); | ||
367 | if (m_postOnRez) | 362 | if (m_postOnRez) |
368 | { | 363 | { |
369 | PostEvent(new EventParams("on_rez", | 364 | PostEvent(new EventParams("on_rez", |
@@ -395,10 +390,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
395 | } | 390 | } |
396 | else | 391 | else |
397 | { | 392 | { |
398 | if (!Run) | 393 | if (m_startOnInit) |
399 | return; | 394 | Start(); |
400 | |||
401 | Start(); | ||
402 | PostEvent(new EventParams("state_entry", | 395 | PostEvent(new EventParams("state_entry", |
403 | new Object[0], new DetectParams[0])); | 396 | new Object[0], new DetectParams[0])); |
404 | if (m_postOnRez) | 397 | if (m_postOnRez) |