aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Null/NullRegionData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/Null/NullRegionData.cs')
-rw-r--r--OpenSim/Data/Null/NullRegionData.cs20
1 files changed, 11 insertions, 9 deletions
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs
index d28cd99..595db2f 100644
--- a/OpenSim/Data/Null/NullRegionData.cs
+++ b/OpenSim/Data/Null/NullRegionData.cs
@@ -134,21 +134,22 @@ namespace OpenSim.Data.Null
134 if (m_useStaticInstance && Instance != this) 134 if (m_useStaticInstance && Instance != this)
135 return Instance.Get(posX, posY, scopeID); 135 return Instance.Get(posX, posY, scopeID);
136 136
137 List<RegionData> ret = new List<RegionData>(); 137 RegionData ret = null;
138 138
139 lock (m_regionData) 139 lock (m_regionData)
140 { 140 {
141 foreach (RegionData r in m_regionData.Values) 141 foreach (RegionData r in m_regionData.Values)
142 { 142 {
143 if (r.posX == posX && r.posY == posY) 143 if (posX >= r.posX && posX < r.posX + r.sizeX
144 ret.Add(r); 144 && posY >= r.posY && posY < r.posY + r.sizeY)
145 {
146 ret = r;
147 break;
148 }
145 } 149 }
146 } 150 }
147 151
148 if (ret.Count > 0) 152 return ret;
149 return ret[0];
150
151 return null;
152 } 153 }
153 154
154 public RegionData Get(UUID regionID, UUID scopeID) 155 public RegionData Get(UUID regionID, UUID scopeID)
@@ -176,8 +177,9 @@ namespace OpenSim.Data.Null
176 { 177 {
177 foreach (RegionData r in m_regionData.Values) 178 foreach (RegionData r in m_regionData.Values)
178 { 179 {
179 if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY) 180 if (r.posX + r.sizeX > startX && r.posX <= endX
180 ret.Add(r); 181 && r.posY + r.sizeX > startY && r.posY <= endY)
182 ret.Add(r);
181 } 183 }
182 } 184 }
183 185