diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 23 |
1 files changed, 23 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 f4d5562..15fbbfd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2926,6 +2926,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2926 | return ret; | 2926 | return ret; |
2927 | } | 2927 | } |
2928 | 2928 | ||
2929 | public LSL_Vector osGetRegionSize() | ||
2930 | { | ||
2931 | CheckThreatLevel(ThreatLevel.None, "osGetRegionSize"); | ||
2932 | m_host.AddScriptLPS(1); | ||
2933 | |||
2934 | bool isMegaregion; | ||
2935 | IRegionCombinerModule rcMod = World.RequestModuleInterface<IRegionCombinerModule>(); | ||
2936 | if (rcMod != null) | ||
2937 | isMegaregion = rcMod.IsRootForMegaregion(World.RegionInfo.RegionID); | ||
2938 | else | ||
2939 | isMegaregion = false; | ||
2940 | |||
2941 | if (isMegaregion) | ||
2942 | { | ||
2943 | Vector2 size = rcMod.GetSizeOfMegaregion(World.RegionInfo.RegionID); | ||
2944 | return new LSL_Vector(size.X, size.Y, Constants.RegionHeight); | ||
2945 | } | ||
2946 | else | ||
2947 | { | ||
2948 | return new LSL_Vector((float)Constants.RegionSize, (float)Constants.RegionSize, Constants.RegionHeight); | ||
2949 | } | ||
2950 | } | ||
2951 | |||
2929 | public int osGetSimulatorMemory() | 2952 | public int osGetSimulatorMemory() |
2930 | { | 2953 | { |
2931 | CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); | 2954 | CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); |