aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-07 19:07:23 +0000
committerJustin Clarke Casey2009-04-07 19:07:23 +0000
commitd0d481a0ab12173fd03c4b6151ee504e3e10b7da (patch)
tree429594aa43f07aea5e0cafd8108ac8e0eeb24803
parent* Apply http://opensimulator.org/mantis/view.php?id=3227 (diff)
downloadopensim-SC_OLD-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.zip
opensim-SC_OLD-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.tar.gz
opensim-SC_OLD-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.tar.bz2
opensim-SC_OLD-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=3418
* Prevents occasional wind module related exceptions on region server shutdown * Thanks Intimidated!
-rw-r--r--CONTRIBUTORS.txt1
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs16
2 files changed, 11 insertions, 6 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 0217476..8b0a616 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -60,6 +60,7 @@ Patches
60* Grumly57 60* Grumly57
61* Fly-Man 61* Fly-Man
62* Flyte Xevious 62* Flyte Xevious
63* Intimidated
63* jhurliman 64* jhurliman
64* jimbo2120 (IBM) 65* jimbo2120 (IBM)
65* John R Sohn (XenReborn) 66* John R Sohn (XenReborn)
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs
index cdd5a2e..2c371da 100644
--- a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs
@@ -82,14 +82,18 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
82 82
83 public void WindUpdate(uint frame) 83 public void WindUpdate(uint frame)
84 { 84 {
85 for (int y = 0; y < 16; y++) 85 //Make sure our object is valid (we haven't been disposed of yet)
86 if (m_windSpeeds != null)
86 { 87 {
87 for (int x = 0; x < 16; x++) 88 for (int y = 0; y < 16; y++)
88 { 89 {
89 m_windSpeeds[y * 16 + x].X = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 90 for (int x = 0; x < 16; x++)
90 m_windSpeeds[y * 16 + x].Y = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1 91 {
91 m_windSpeeds[y * 16 + x].X *= m_strength; 92 m_windSpeeds[y * 16 + x].X = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1
92 m_windSpeeds[y * 16 + x].Y *= m_strength; 93 m_windSpeeds[y * 16 + x].Y = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1
94 m_windSpeeds[y * 16 + x].X *= m_strength;
95 m_windSpeeds[y * 16 + x].Y *= m_strength;
96 }
93 } 97 }
94 } 98 }
95 } 99 }