diff options
author | SignpostMarv | 2012-07-27 10:49:47 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-28 00:09:11 +0100 |
commit | 72d29bdb40c16ba4785b16e4025bf810baa96cb5 (patch) | |
tree | e68e7163cb1ef623d961f397560b6f9e5db3be3f /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |
parent | Avoid a race condition between the scene shutdown thread and the update threa... (diff) | |
download | opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.zip opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.tar.gz opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.tar.bz2 opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.tar.xz |
LSL/OSSL lacks Math.Min & Math.Max implementations.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index faad75d..44de176 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3286,5 +3286,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3286 | UUID test; | 3286 | UUID test; |
3287 | return UUID.TryParse(thing, out test) ? 1 : 0; | 3287 | return UUID.TryParse(thing, out test) ? 1 : 0; |
3288 | } | 3288 | } |
3289 | |||
3290 | /// <summary> | ||
3291 | /// Wraps to Math.Min() | ||
3292 | /// </summary> | ||
3293 | /// <param name="a"></param> | ||
3294 | /// <param name="b"></param> | ||
3295 | /// <returns></returns> | ||
3296 | public LSL_Float osMin(double a, double b) | ||
3297 | { | ||
3298 | CheckThreatLevel(ThreatLevel.None, "osMin"); | ||
3299 | m_host.AddScriptLPS(1); | ||
3300 | |||
3301 | return Math.Min(a, b); | ||
3302 | } | ||
3303 | |||
3304 | /// <summary> | ||
3305 | /// Wraps to Math.max() | ||
3306 | /// </summary> | ||
3307 | /// <param name="a"></param> | ||
3308 | /// <param name="b"></param> | ||
3309 | /// <returns></returns> | ||
3310 | public LSL_Float osMax(double a, double b) | ||
3311 | { | ||
3312 | CheckThreatLevel(ThreatLevel.None, "osMax"); | ||
3313 | m_host.AddScriptLPS(1); | ||
3314 | |||
3315 | return Math.Max(a, b); | ||
3316 | } | ||
3289 | } | 3317 | } |
3290 | } \ No newline at end of file | 3318 | } \ No newline at end of file |