From acebfeb5c96c3f11a514541069d3d7d81697b500 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 13 Jul 2016 15:56:01 +0100 Subject: don't overlap Select and Deselect, fix deselect prims account --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 43 +++++++++++++++------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 0a7f1a8..bd6cafc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -7681,15 +7681,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP #endregion ObjectSelect handlerObjectSelect = null; - - for (int i = 0; i < incomingselect.ObjectData.Length; i++) + uint objID; + lock(SelectedObjects) { - if (!SelectedObjects.Contains(incomingselect.ObjectData[i].ObjectLocalID)) - SelectedObjects.Add(incomingselect.ObjectData[i].ObjectLocalID); - handlerObjectSelect = OnObjectSelect; - if (handlerObjectSelect != null) + for (int i = 0; i < incomingselect.ObjectData.Length; i++) { - handlerObjectSelect(incomingselect.ObjectData[i].ObjectLocalID, this); + objID = incomingselect.ObjectData[i].ObjectLocalID; + + if (!SelectedObjects.Contains(objID)) + { + SelectedObjects.Add(objID); + + handlerObjectSelect = OnObjectSelect; + if (handlerObjectSelect != null) + { + handlerObjectSelect(objID, this); + } + } } } return true; @@ -7709,15 +7717,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP #endregion ObjectDeselect handlerObjectDeselect = null; - - for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) + uint objID; + lock(SelectedObjects) { - if (!SelectedObjects.Contains(incomingdeselect.ObjectData[i].ObjectLocalID)) - SelectedObjects.Add(incomingdeselect.ObjectData[i].ObjectLocalID); - handlerObjectDeselect = OnObjectDeselect; - if (handlerObjectDeselect != null) + for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) { - OnObjectDeselect(incomingdeselect.ObjectData[i].ObjectLocalID, this); + objID = incomingdeselect.ObjectData[i].ObjectLocalID; + if (SelectedObjects.Contains(objID)) + { + SelectedObjects.Remove(objID); + + handlerObjectDeselect = OnObjectDeselect; + if (handlerObjectDeselect != null) + { + OnObjectDeselect(objID, this); + } + } } } return true; -- cgit v1.1