From 72d29bdb40c16ba4785b16e4025bf810baa96cb5 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 27 Jul 2012 10:49:47 +0100
Subject: LSL/OSSL lacks Math.Min & Math.Max implementations.
---
.../Shared/Api/Implementation/OSSL_Api.cs | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
(limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
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
UUID test;
return UUID.TryParse(thing, out test) ? 1 : 0;
}
+
+ ///
+ /// Wraps to Math.Min()
+ ///
+ ///
+ ///
+ ///
+ public LSL_Float osMin(double a, double b)
+ {
+ CheckThreatLevel(ThreatLevel.None, "osMin");
+ m_host.AddScriptLPS(1);
+
+ return Math.Min(a, b);
+ }
+
+ ///
+ /// Wraps to Math.max()
+ ///
+ ///
+ ///
+ ///
+ public LSL_Float osMax(double a, double b)
+ {
+ CheckThreatLevel(ThreatLevel.None, "osMax");
+ m_host.AddScriptLPS(1);
+
+ return Math.Max(a, b);
+ }
}
}
\ No newline at end of file
--
cgit v1.1