aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2019-11-07 03:00:56 +0000
committerUbitUmarov2019-11-07 03:01:07 +0000
commitbd9f6ae3f079afaf5de29055f5c6e666fa796914 (patch)
tree8150eacf18cebd803b80c2bac73875075be08a2b /OpenSim
parenthandle null refs on llSubStringIndex() (diff)
downloadopensim-SC-bd9f6ae3f079afaf5de29055f5c6e666fa796914.zip
opensim-SC-bd9f6ae3f079afaf5de29055f5c6e666fa796914.tar.gz
opensim-SC-bd9f6ae3f079afaf5de29055f5c6e666fa796914.tar.bz2
opensim-SC-bd9f6ae3f079afaf5de29055f5c6e666fa796914.tar.xz
avoid a null ref
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs34
1 files changed, 23 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 22ad3c0..0761bbb 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -78,10 +78,12 @@ namespace OpenSim.Region.Framework.Scenes
78 { 78 {
79 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 79 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
80 80
81// ~ScenePresence() 81 public int MaxNumberAttachments { get; } = 38; // per viewers limit
82// { 82
83// m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name); 83 // ~ScenePresence()
84// } 84 // {
85 // m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name);
86 // }
85 87
86 public void TriggerScenePresenceUpdated() 88 public void TriggerScenePresenceUpdated()
87 { 89 {
@@ -303,7 +305,11 @@ namespace OpenSim.Region.Framework.Scenes
303 public bool Flying 305 public bool Flying
304 { 306 {
305 get { return PhysicsActor != null && PhysicsActor.Flying; } 307 get { return PhysicsActor != null && PhysicsActor.Flying; }
306 set { PhysicsActor.Flying = value; } 308 set
309 {
310 if(PhysicsActor != null)
311 PhysicsActor.Flying = value;
312 }
307 } 313 }
308 314
309 public bool IsColliding 315 public bool IsColliding
@@ -5406,6 +5412,12 @@ namespace OpenSim.Region.Framework.Scenes
5406 bakedModule.UpdateMeshAvatar(m_uuid); 5412 bakedModule.UpdateMeshAvatar(m_uuid);
5407 } 5413 }
5408 5414
5415 public int GetAttachmentsCount()
5416 {
5417 return m_attachments.Count;
5418 }
5419
5420
5409 /// <summary> 5421 /// <summary>
5410 /// Get all the presence's attachments. 5422 /// Get all the presence's attachments.
5411 /// </summary> 5423 /// </summary>
@@ -6605,10 +6617,9 @@ namespace OpenSim.Region.Framework.Scenes
6605 if (m_lastColliders.Count == 0) 6617 if (m_lastColliders.Count == 0)
6606 return; // nothing to do 6618 return; // nothing to do
6607 6619
6608 foreach (uint localID in m_lastColliders) 6620 for(int i = 0; i < m_lastColliders.Count; ++i)
6609 { 6621 endedColliders.Add(m_lastColliders[i]);
6610 endedColliders.Add(localID); 6622
6611 }
6612 m_lastColliders.Clear(); 6623 m_lastColliders.Clear();
6613 } 6624 }
6614 else 6625 else
@@ -6668,9 +6679,10 @@ namespace OpenSim.Region.Framework.Scenes
6668 if (soundinfolist.Count > 0) 6679 if (soundinfolist.Count > 0)
6669 CollisionSounds.AvatarCollisionSound(this, soundinfolist); 6680 CollisionSounds.AvatarCollisionSound(this, soundinfolist);
6670 } 6681 }
6671 6682 List<SceneObjectGroup> attachements = GetAttachments();
6672 foreach (SceneObjectGroup att in GetAttachments()) 6683 for (int i = 0; i< attachements.Count; ++i)
6673 { 6684 {
6685 SceneObjectGroup att = attachements[i];
6674 SendCollisionEvent(att, scriptEvents.collision_start, startedColliders, m_scene.EventManager.TriggerScriptCollidingStart); 6686 SendCollisionEvent(att, scriptEvents.collision_start, startedColliders, m_scene.EventManager.TriggerScriptCollidingStart);
6675 SendCollisionEvent(att, scriptEvents.collision , m_lastColliders , m_scene.EventManager.TriggerScriptColliding); 6687 SendCollisionEvent(att, scriptEvents.collision , m_lastColliders , m_scene.EventManager.TriggerScriptColliding);
6676 SendCollisionEvent(att, scriptEvents.collision_end , endedColliders , m_scene.EventManager.TriggerScriptCollidingEnd); 6688 SendCollisionEvent(att, scriptEvents.collision_end , endedColliders , m_scene.EventManager.TriggerScriptCollidingEnd);