diff options
author | Justin Clarke Casey | 2009-04-07 19:07:23 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-04-07 19:07:23 +0000 |
commit | d0d481a0ab12173fd03c4b6151ee504e3e10b7da (patch) | |
tree | 429594aa43f07aea5e0cafd8108ac8e0eeb24803 /OpenSim/Region/CoreModules/World | |
parent | * Apply http://opensimulator.org/mantis/view.php?id=3227 (diff) | |
download | opensim-SC-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.zip opensim-SC-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.tar.gz opensim-SC-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.tar.bz2 opensim-SC-d0d481a0ab12173fd03c4b6151ee504e3e10b7da.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=3418
* Prevents occasional wind module related exceptions on region server shutdown
* Thanks Intimidated!
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs | 16 |
1 files changed, 10 insertions, 6 deletions
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 | } |