diff options
author | UbitUmarov | 2015-12-14 12:29:00 +0000 |
---|---|---|
committer | UbitUmarov | 2015-12-14 12:29:00 +0000 |
commit | e37e8c3bdfde9143a898959fc7c92091262a3905 (patch) | |
tree | 3681f976359169fd029494a15e3d5a463b7290c4 /OpenSim/Region | |
parent | calculate land startpoint, endpoint and center estimate when it is updated, i... (diff) | |
download | opensim-SC_OLD-e37e8c3bdfde9143a898959fc7c92091262a3905.zip opensim-SC_OLD-e37e8c3bdfde9143a898959fc7c92091262a3905.tar.gz opensim-SC_OLD-e37e8c3bdfde9143a898959fc7c92091262a3905.tar.bz2 opensim-SC_OLD-e37e8c3bdfde9143a898959fc7c92091262a3905.tar.xz |
on join parcels, keep the information of the larger parcel, since thats how its expected now
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 329fa81..08b9896 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1031,52 +1031,57 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1031 | /// <summary> | 1031 | /// <summary> |
1032 | /// Join 2 land objects together | 1032 | /// Join 2 land objects together |
1033 | /// </summary> | 1033 | /// </summary> |
1034 | /// <param name="start_x">x value in first piece of land</param> | 1034 | /// <param name="start_x">start x of selection area</param> |
1035 | /// <param name="start_y">y value in first piece of land</param> | 1035 | /// <param name="start_y">start y of selection area</param> |
1036 | /// <param name="end_x">x value in second peice of land</param> | 1036 | /// <param name="end_x">end x of selection area</param> |
1037 | /// <param name="end_y">y value in second peice of land</param> | 1037 | /// <param name="end_y">end y of selection area</param> |
1038 | /// <param name="attempting_user_id">UUID of the avatar trying to join the land objects</param> | 1038 | /// <param name="attempting_user_id">UUID of the avatar trying to join the land objects</param> |
1039 | /// <returns>Returns true if successful</returns> | 1039 | /// <returns>Returns true if successful</returns> |
1040 | private void join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | 1040 | private void join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) |
1041 | { | 1041 | { |
1042 | end_x -= 4; | 1042 | int index = 0; |
1043 | end_y -= 4; | 1043 | int maxindex = -1; |
1044 | int maxArea = 0; | ||
1044 | 1045 | ||
1045 | List<ILandObject> selectedLandObjects = new List<ILandObject>(); | 1046 | List<ILandObject> selectedLandObjects = new List<ILandObject>(); |
1046 | int stepYSelected; | 1047 | for (int x = start_x; x < end_x; x += 4) |
1047 | for (stepYSelected = start_y; stepYSelected <= end_y; stepYSelected += 4) | ||
1048 | { | 1048 | { |
1049 | int stepXSelected; | 1049 | for (int y = start_y; y < end_y; y += 4) |
1050 | for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4) | ||
1051 | { | 1050 | { |
1052 | ILandObject p = GetLandObject(stepXSelected, stepYSelected); | 1051 | ILandObject p = GetLandObject(x, y); |
1053 | 1052 | ||
1054 | if (p != null) | 1053 | if (p != null) |
1055 | { | 1054 | { |
1056 | if (!selectedLandObjects.Contains(p)) | 1055 | if (!selectedLandObjects.Contains(p)) |
1057 | { | 1056 | { |
1058 | selectedLandObjects.Add(p); | 1057 | selectedLandObjects.Add(p); |
1058 | if(p.LandData.Area > maxArea) | ||
1059 | { | ||
1060 | maxArea = p.LandData.Area; | ||
1061 | maxindex = index; | ||
1062 | } | ||
1063 | index++; | ||
1059 | } | 1064 | } |
1060 | } | 1065 | } |
1061 | } | 1066 | } |
1062 | } | 1067 | } |
1063 | ILandObject masterLandObject = selectedLandObjects[0]; | ||
1064 | selectedLandObjects.RemoveAt(0); | ||
1065 | 1068 | ||
1066 | if (selectedLandObjects.Count < 1) | 1069 | if(maxindex < 0 || selectedLandObjects.Count < 2) |
1067 | { | ||
1068 | return; | 1070 | return; |
1069 | } | 1071 | |
1072 | ILandObject masterLandObject = selectedLandObjects[maxindex]; | ||
1073 | selectedLandObjects.RemoveAt(maxindex); | ||
1074 | |||
1070 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin, true)) | 1075 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin, true)) |
1071 | { | 1076 | { |
1072 | return; | 1077 | return; |
1073 | } | 1078 | } |
1079 | |||
1080 | UUID masterOwner = masterLandObject.LandData.OwnerID; | ||
1074 | foreach (ILandObject p in selectedLandObjects) | 1081 | foreach (ILandObject p in selectedLandObjects) |
1075 | { | 1082 | { |
1076 | if (p.LandData.OwnerID != masterLandObject.LandData.OwnerID) | 1083 | if (p.LandData.OwnerID != masterOwner) |
1077 | { | ||
1078 | return; | 1084 | return; |
1079 | } | ||
1080 | } | 1085 | } |
1081 | 1086 | ||
1082 | lock (m_landList) | 1087 | lock (m_landList) |