aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
1 files changed, 8 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index fcd94a4..32ebc37 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1031,17 +1031,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1031 m_host.AddScriptLPS(1); 1031 m_host.AddScriptLPS(1);
1032 LSL_Vector wind = new LSL_Vector(0, 0, 0); 1032 LSL_Vector wind = new LSL_Vector(0, 0, 0);
1033 IWindModule module = World.RequestModuleInterface<IWindModule>(); 1033 IWindModule module = World.RequestModuleInterface<IWindModule>();
1034 if (module != null && module.WindSpeeds != null) 1034 if (module != null)
1035 { 1035 {
1036 Vector3 pos = m_host.GetWorldPosition(); 1036 Vector3 pos = m_host.GetWorldPosition();
1037 int x = (int)((pos.X + offset.x)/ 16); 1037 int x = (int)(pos.X + offset.x);
1038 int y = (int)((pos.Y + offset.y)/ 16); 1038 int y = (int)(pos.Y + offset.y);
1039 if (x < 0) x = 0; 1039
1040 if (x > 15) x = 15; 1040 Vector3 windSpeed = module.WindSpeed(x, y, 0);
1041 if (y < 0) y = 0; 1041
1042 if (y > 15) y = 15; 1042 wind.x = windSpeed.X;
1043 wind.x = module.WindSpeeds[y * 16 + x].X; 1043 wind.y = windSpeed.Y;
1044 wind.y = module.WindSpeeds[y * 16 + x].Y;
1045 } 1044 }
1046 return wind; 1045 return wind;
1047 } 1046 }