mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
If the land has no group ownership (it is UUID.Zero) then don't put prims in the group count when they are also not group owned.
Also adds simple test for others owned count when an object is added
This commit is contained in:
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (obj.OwnerID == landData.GroupID)
|
||||
parcelCounts.Owner += partCount;
|
||||
else if (obj.GroupID == landData.GroupID)
|
||||
else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
|
||||
parcelCounts.Group += partCount;
|
||||
else
|
||||
parcelCounts.Others += partCount;
|
||||
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (obj.OwnerID == landData.OwnerID)
|
||||
parcelCounts.Owner += partCount;
|
||||
else if (obj.GroupID == landData.GroupID)
|
||||
else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
|
||||
parcelCounts.Group += partCount;
|
||||
else
|
||||
parcelCounts.Others += partCount;
|
||||
|
||||
@@ -161,6 +161,27 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||
Assert.That(pc.Simulator, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAddOthersObject()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
IPrimCounts pc = m_lo.PrimCounts;
|
||||
|
||||
SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_dummyUserId, 0x01);
|
||||
m_scene.AddNewSceneObject(sog, false);
|
||||
|
||||
Assert.That(pc.Owner, Is.EqualTo(0));
|
||||
Assert.That(pc.Group, Is.EqualTo(0));
|
||||
Assert.That(pc.Others, Is.EqualTo(3));
|
||||
Assert.That(pc.Total, Is.EqualTo(3));
|
||||
Assert.That(pc.Selected, Is.EqualTo(0));
|
||||
Assert.That(pc.Users[m_userId], Is.EqualTo(0));
|
||||
Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(3));
|
||||
Assert.That(pc.Simulator, Is.EqualTo(3));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the count is correct after is has been tainted.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user