diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/TerrainChannel.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index a5b42ff..b4b1823 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs | |||
@@ -156,7 +156,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
156 | // ITerrainChannel.this[x,y] | 156 | // ITerrainChannel.this[x,y] |
157 | public double this[int x, int y] | 157 | public double this[int x, int y] |
158 | { | 158 | { |
159 | get { return (double)m_terrainData[x, y]; } | 159 | get { |
160 | if (x < 0 || x >= Width || y < 0 || y >= Height) | ||
161 | return 0; | ||
162 | return (double)m_terrainData[x, y]; | ||
163 | } | ||
160 | set | 164 | set |
161 | { | 165 | { |
162 | if (Double.IsNaN(value) || Double.IsInfinity(value)) | 166 | if (Double.IsNaN(value) || Double.IsInfinity(value)) |
@@ -166,6 +170,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
166 | } | 170 | } |
167 | } | 171 | } |
168 | 172 | ||
173 | // ITerrainChannel.GetHieghtAtXYZ(x, y, z) | ||
174 | public float GetHeightAtXYZ(float x, float y, float z) | ||
175 | { | ||
176 | if (x < 0 || x >= Width || y < 0 || y >= Height) | ||
177 | return 0; | ||
178 | return m_terrainData[(int)x, (int)y]; | ||
179 | } | ||
180 | |||
169 | // ITerrainChannel.Tainted() | 181 | // ITerrainChannel.Tainted() |
170 | public bool Tainted(int x, int y) | 182 | public bool Tainted(int x, int y) |
171 | { | 183 | { |