diff options
author | Teravus Ovares | 2008-03-23 07:10:04 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-03-23 07:10:04 +0000 |
commit | f82227a1865e95ebc86a43c732bfd77ef97d3814 (patch) | |
tree | 556f3f309b537dbaf43b9f00d65a18671a19b284 /OpenSim/Region | |
parent | * Implements Oriented Bounding Box raytracing. (diff) | |
download | opensim-SC_OLD-f82227a1865e95ebc86a43c732bfd77ef97d3814.zip opensim-SC_OLD-f82227a1865e95ebc86a43c732bfd77ef97d3814.tar.gz opensim-SC_OLD-f82227a1865e95ebc86a43c732bfd77ef97d3814.tar.bz2 opensim-SC_OLD-f82227a1865e95ebc86a43c732bfd77ef97d3814.tar.xz |
* Added a little more stability for getting the object list from the parcel box. (previously it crashed my simulator)
* Found and gracefully handled a few situations where null references occur. (m_rootPart again!)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 16 |
2 files changed, 31 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs index 1311fd3..68e8fcf 100644 --- a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs | |||
@@ -763,11 +763,25 @@ namespace OpenSim.Region.Environment.Modules.LandManagement | |||
763 | 763 | ||
764 | foreach (SceneObjectGroup obj in primsOverMe) | 764 | foreach (SceneObjectGroup obj in primsOverMe) |
765 | { | 765 | { |
766 | if (!ownersAndCount.ContainsKey(obj.OwnerID)) | 766 | try |
767 | { | ||
768 | if (!ownersAndCount.ContainsKey(obj.OwnerID)) | ||
769 | { | ||
770 | ownersAndCount.Add(obj.OwnerID, 0); | ||
771 | } | ||
772 | } | ||
773 | catch (NullReferenceException) | ||
774 | { | ||
775 | m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); | ||
776 | } | ||
777 | try | ||
778 | { | ||
779 | ownersAndCount[obj.OwnerID] += obj.PrimCount; | ||
780 | } | ||
781 | catch (KeyNotFoundException) | ||
767 | { | 782 | { |
768 | ownersAndCount.Add(obj.OwnerID, 0); | 783 | m_log.Error("[LAND]: Unable to match a prim with it's owner."); |
769 | } | 784 | } |
770 | ownersAndCount[obj.OwnerID] += obj.PrimCount; | ||
771 | } | 785 | } |
772 | if (ownersAndCount.Count > 0) | 786 | if (ownersAndCount.Count > 0) |
773 | { | 787 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 1e63ae7..2875874 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -161,7 +161,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
161 | 161 | ||
162 | public override uint LocalId | 162 | public override uint LocalId |
163 | { | 163 | { |
164 | get { return m_rootPart.LocalId; } | 164 | get { |
165 | if (m_rootPart == null) | ||
166 | { | ||
167 | m_log.Error("[PRIMGROUP]: Unable to find the rootpart for a LocalId Request!"); | ||
168 | return 0; | ||
169 | } | ||
170 | |||
171 | return m_rootPart.LocalId; } | ||
165 | set { m_rootPart.LocalId = value; } | 172 | set { m_rootPart.LocalId = value; } |
166 | } | 173 | } |
167 | 174 | ||
@@ -173,7 +180,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
173 | 180 | ||
174 | public LLUUID OwnerID | 181 | public LLUUID OwnerID |
175 | { | 182 | { |
176 | get { return m_rootPart.OwnerID; } | 183 | get { |
184 | if (m_rootPart == null) | ||
185 | return LLUUID.Zero; | ||
186 | |||
187 | return m_rootPart.OwnerID; | ||
188 | } | ||
177 | set { m_rootPart.OwnerID = value; } | 189 | set { m_rootPart.OwnerID = value; } |
178 | } | 190 | } |
179 | 191 | ||