diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 956a500..d410a59 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -953,7 +953,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
953 | public LSL_Vector llWind(LSL_Vector offset) | 953 | public LSL_Vector llWind(LSL_Vector offset) |
954 | { | 954 | { |
955 | m_host.AddScriptLPS(1); | 955 | m_host.AddScriptLPS(1); |
956 | return new LSL_Vector(); | 956 | LSL_Vector wind = new LSL_Vector(0, 0, 0); |
957 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | ||
958 | if (module != null && module.WindSpeeds != null) | ||
959 | { | ||
960 | Vector3 pos = m_host.GetWorldPosition(); | ||
961 | int x = (int)((pos.X + offset.x)/ 16); | ||
962 | int y = (int)((pos.Y + offset.y)/ 16); | ||
963 | if (x < 0) x = 0; | ||
964 | if (x > 15) x = 15; | ||
965 | if (y < 0) y = 0; | ||
966 | if (y > 15) y = 15; | ||
967 | wind.x = module.WindSpeeds[y * 16 + x].X; | ||
968 | wind.y = module.WindSpeeds[y * 16 + x].Y; | ||
969 | } | ||
970 | return wind; | ||
957 | } | 971 | } |
958 | 972 | ||
959 | public void llSetStatus(int status, int value) | 973 | public void llSetStatus(int status, int value) |