From b9c2a1508e68b5580328097a5d5e0b5bfbc16a7d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 12 Oct 2012 03:19:12 +0100
Subject: Fix problems with regression tests by allowing invoke of Update()
with a finite number of frames even if the scene isn't active.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 7 ++++---
.../Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7f4f7e5..fe549bc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -310,7 +310,8 @@ namespace OpenSim.Region.Framework.Scenes
/// Is the scene active?
///
///
- /// If false, maintenance and update loops are not run.
+ /// If false, maintenance and update loops are not being run. Updates can still be triggered manually if
+ /// the scene is not active.
///
public bool Active
{
@@ -1430,7 +1431,7 @@ namespace OpenSim.Region.Framework.Scenes
List coarseLocations;
List avatarUUIDs;
- while (Active && !m_shuttingDown && (endRun == null || MaintenanceRun < endRun))
+ while (!m_shuttingDown && ((endRun == null && Active) || MaintenanceRun < endRun))
{
runtc = Util.EnvironmentTickCount();
++MaintenanceRun;
@@ -1489,7 +1490,7 @@ namespace OpenSim.Region.Framework.Scenes
int previousFrameTick, tmpMS;
int maintc = Util.EnvironmentTickCount();
- while (Active && !m_shuttingDown && (endFrame == null || Frame < endFrame))
+ while (!m_shuttingDown && ((endFrame == null && Active) || Frame < endFrame))
{
++Frame;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
index 1d1ff88..9a871f0 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
@@ -65,6 +65,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
public void Init()
{
m_scene = new SceneHelpers().SetupScene();
+ m_scene.Start();
}
[Test]
--
cgit v1.1