diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 15 |
1 files changed, 9 insertions, 6 deletions
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 | |||
72 | 72 | ||
73 | public InnerScene m_innerScene; | 73 | public InnerScene m_innerScene; |
74 | 74 | ||
75 | // private Random Rand = new Random(); | 75 | /// <summary> |
76 | private uint _primCount = 720000; | 76 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is |
77 | /// dispenced. | ||
78 | /// </summary> | ||
79 | private uint m_localId = 720000; | ||
80 | |||
77 | private readonly Mutex _primAllocateMutex = new Mutex(false); | 81 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
78 | 82 | ||
79 | private int m_timePhase = 24; | 83 | private int m_timePhase = 24; |
@@ -1493,16 +1497,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1493 | } | 1497 | } |
1494 | 1498 | ||
1495 | /// <summary> | 1499 | /// <summary> |
1496 | /// Returns a new unallocated primitive ID | 1500 | /// Returns a new unallocated local primitive ID |
1497 | /// </summary> | 1501 | /// </summary> |
1498 | /// <returns>A brand new primitive ID</returns> | 1502 | /// <returns>A brand new local primitive ID</returns> |
1499 | public uint PrimIDAllocate() | 1503 | public uint PrimIDAllocate() |
1500 | { | 1504 | { |
1501 | uint myID; | 1505 | uint myID; |
1502 | 1506 | ||
1503 | _primAllocateMutex.WaitOne(); | 1507 | _primAllocateMutex.WaitOne(); |
1504 | ++_primCount; | 1508 | myID = ++m_localId; |
1505 | myID = _primCount; | ||
1506 | _primAllocateMutex.ReleaseMutex(); | 1509 | _primAllocateMutex.ReleaseMutex(); |
1507 | 1510 | ||
1508 | return myID; | 1511 | return myID; |