diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Wind/WindModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Wind/WindModule.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 3283c1f..9736b73 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs | |||
@@ -425,9 +425,7 @@ namespace OpenSim.Region.CoreModules | |||
425 | { | 425 | { |
426 | if (m_ready) | 426 | if (m_ready) |
427 | { | 427 | { |
428 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 428 | if(m_scene.GetRootAgentCount() > 0) |
429 | |||
430 | if (avatars.Count > 0) | ||
431 | { | 429 | { |
432 | // Ask wind plugin to generate a LL wind array to be cached locally | 430 | // Ask wind plugin to generate a LL wind array to be cached locally |
433 | // Try not to update this too often, as it may involve array copies | 431 | // Try not to update this too often, as it may involve array copies |
@@ -437,11 +435,11 @@ namespace OpenSim.Region.CoreModules | |||
437 | m_frameLastUpdateClientArray = m_frame; | 435 | m_frameLastUpdateClientArray = m_frame; |
438 | } | 436 | } |
439 | 437 | ||
440 | foreach (ScenePresence avatar in avatars) | 438 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) |
441 | { | 439 | { |
442 | if (!avatar.IsChildAgent) | 440 | if (!sp.IsChildAgent) |
443 | avatar.ControllingClient.SendWindData(windSpeeds); | 441 | sp.ControllingClient.SendWindData(windSpeeds); |
444 | } | 442 | }); |
445 | } | 443 | } |
446 | } | 444 | } |
447 | } | 445 | } |