From 000d5e8b93c865f7be21717a52a5a897b0ce3344 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 12 Jul 2008 21:03:12 +0000 Subject: * minor: just some null guards and name changes to make it clearer that prim count is actually a prim local id dispenser --- OpenSim/Region/Environment/Scenes/Scene.cs | 15 +++++++++------ .../Environment/Scenes/SceneObjectPart.Inventory.cs | 6 +++--- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 1 - 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d6bbb1f..a0df9a1 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -72,8 +72,12 @@ namespace OpenSim.Region.Environment.Scenes public InnerScene m_innerScene; - // private Random Rand = new Random(); - private uint _primCount = 720000; + /// + /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is + /// dispenced. + /// + private uint m_localId = 720000; + private readonly Mutex _primAllocateMutex = new Mutex(false); private int m_timePhase = 24; @@ -1493,16 +1497,15 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Returns a new unallocated primitive ID + /// Returns a new unallocated local primitive ID /// - /// A brand new primitive ID + /// A brand new local primitive ID public uint PrimIDAllocate() { uint myID; _primAllocateMutex.WaitOne(); - ++_primCount; - myID = _primCount; + myID = ++m_localId; _primAllocateMutex.ReleaseMutex(); return myID; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 0b48464..005d872 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -182,10 +182,10 @@ namespace OpenSim.Region.Environment.Scenes } else { - m_taskInventory[item.ItemID].PermsMask = 0; - m_taskInventory[item.ItemID].PermsGranter = LLUUID.Zero; + m_taskInventory[item.ItemID].PermsMask = 0; + m_taskInventory[item.ItemID].PermsGranter = LLUUID.Zero; string script = Helpers.FieldToUTF8String(asset.Data); - m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId,item.ItemID,script, startParam, postOnRez); + m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId, item.ItemID,script, startParam, postOnRez); m_parentGroup.AddActiveScriptCount(1); ScheduleFullUpdate(); } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 685a3d5..8bf8575 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -141,7 +141,6 @@ namespace OpenSim.Region.Environment.Scenes public uint m_attachmentPoint = (byte)0; [XmlIgnore] public PhysicsVector m_rotationAxis = new PhysicsVector(1f,1f,1f); - [XmlIgnore] public bool m_undoing = false; -- cgit v1.1