Prevent spurious error message when client tries to move a null item

avinationmerge
Melanie 2011-12-10 14:47:00 +01:00
parent 6b080d57cb
commit db98698bbe
2 changed files with 154 additions and 130 deletions

View File

@ -1105,6 +1105,10 @@ namespace OpenSim.Region.Framework.Scenes
{ {
SceneObjectPart part = GetSceneObjectPart(primLocalId); SceneObjectPart part = GetSceneObjectPart(primLocalId);
// Can't move a null item
if (itemId == UUID.Zero)
return;
if (null == part) if (null == part)
{ {
m_log.WarnFormat( m_log.WarnFormat(

View File

@ -214,6 +214,9 @@ namespace OpenSim.Region.Framework.Scenes
//private int m_moveToPositionStateStatus; //private int m_moveToPositionStateStatus;
//***************************************************** //*****************************************************
private bool m_collisionEventFlag = false;
private object m_collisionEventLock = new Object();
protected AvatarAppearance m_appearance; protected AvatarAppearance m_appearance;
public AvatarAppearance Appearance public AvatarAppearance Appearance
@ -3859,6 +3862,17 @@ namespace OpenSim.Region.Framework.Scenes
} }
private void RaiseCollisionScriptEvents(Dictionary<uint, ContactPoint> coldata) private void RaiseCollisionScriptEvents(Dictionary<uint, ContactPoint> coldata)
{
lock(m_collisionEventLock)
{
if (m_collisionEventFlag)
return;
m_collisionEventFlag = true;
}
Util.FireAndForget(delegate(object x)
{
try
{ {
List<uint> thisHitColliders = new List<uint>(); List<uint> thisHitColliders = new List<uint>();
List<uint> endedColliders = new List<uint>(); List<uint> endedColliders = new List<uint>();
@ -4002,5 +4016,11 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
finally
{
m_collisionEventFlag = false;
}
});
}
} }
} }