Fix collision filtering. The filter should be checked on the receiving part!

0.7.4.1
Melanie 2012-05-29 18:18:47 +01:00
parent 79f3ce2e9f
commit b660c4991b
1 changed files with 9 additions and 9 deletions

View File

@ -2023,21 +2023,21 @@ namespace OpenSim.Region.Framework.Scenes
{ {
} }
private bool CollisionFilteredOut(SceneObjectPart dest, UUID objectID, string objectName) public bool CollisionFilteredOut(UUID objectID, string objectName)
{ {
if(dest.CollisionFilter.Count == 0) if(CollisionFilter.Count == 0)
return false; return false;
if (dest.CollisionFilter.ContainsValue(objectID.ToString()) || if (CollisionFilter.ContainsValue(objectID.ToString()) ||
dest.CollisionFilter.ContainsValue(objectID.ToString() + objectName) || CollisionFilter.ContainsValue(objectID.ToString() + objectName) ||
dest.CollisionFilter.ContainsValue(UUID.Zero.ToString() + objectName)) CollisionFilter.ContainsValue(UUID.Zero.ToString() + objectName))
{ {
if (dest.CollisionFilter.ContainsKey(1)) if (CollisionFilter.ContainsKey(1))
return false; return false;
return true; return true;
} }
if (dest.CollisionFilter.ContainsKey(1)) if (CollisionFilter.ContainsKey(1))
return true; return true;
return false; return false;
@ -2100,7 +2100,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId); SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId);
if (obj != null) if (obj != null)
{ {
if (!dest.CollisionFilteredOut(this, obj.UUID, obj.Name)) if (!dest.CollisionFilteredOut(obj.UUID, obj.Name))
colliding.Add(CreateDetObject(obj)); colliding.Add(CreateDetObject(obj));
} }
else else
@ -2108,7 +2108,7 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence av = ParentGroup.Scene.GetScenePresence(localId); ScenePresence av = ParentGroup.Scene.GetScenePresence(localId);
if (av != null && (!av.IsChildAgent)) if (av != null && (!av.IsChildAgent))
{ {
if (!dest.CollisionFilteredOut(this, av.UUID, av.Name)) if (!dest.CollisionFilteredOut(av.UUID, av.Name))
colliding.Add(CreateDetObject(av)); colliding.Add(CreateDetObject(av));
} }
} }