diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index a5bdc07..e0b4992 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -387,12 +387,14 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
387 | if (!m_initialized) return null; | 387 | if (!m_initialized) return null; |
388 | 388 | ||
389 | BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying); | 389 | BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying); |
390 | lock (PhysObjects) PhysObjects.Add(localID, actor); | 390 | lock (PhysObjects) |
391 | PhysObjects.Add(localID, actor); | ||
391 | 392 | ||
392 | // TODO: Remove kludge someday. | 393 | // TODO: Remove kludge someday. |
393 | // We must generate a collision for avatars whether they collide or not. | 394 | // We must generate a collision for avatars whether they collide or not. |
394 | // This is required by OpenSim to update avatar animations, etc. | 395 | // This is required by OpenSim to update avatar animations, etc. |
395 | lock (m_avatars) m_avatars.Add(actor); | 396 | lock (m_avatars) |
397 | m_avatars.Add(actor); | ||
396 | 398 | ||
397 | return actor; | 399 | return actor; |
398 | } | 400 | } |
@@ -408,9 +410,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
408 | { | 410 | { |
409 | try | 411 | try |
410 | { | 412 | { |
411 | lock (PhysObjects) PhysObjects.Remove(actor.LocalID); | 413 | lock (PhysObjects) |
414 | PhysObjects.Remove(bsactor.LocalID); | ||
412 | // Remove kludge someday | 415 | // Remove kludge someday |
413 | lock (m_avatars) m_avatars.Remove(bsactor); | 416 | lock (m_avatars) |
417 | m_avatars.Remove(bsactor); | ||
414 | } | 418 | } |
415 | catch (Exception e) | 419 | catch (Exception e) |
416 | { | 420 | { |
@@ -419,6 +423,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
419 | bsactor.Destroy(); | 423 | bsactor.Destroy(); |
420 | // bsactor.dispose(); | 424 | // bsactor.dispose(); |
421 | } | 425 | } |
426 | else | ||
427 | { | ||
428 | m_log.ErrorFormat("{0}: Requested to remove avatar that is not a BSCharacter. ID={1}, type={2}", | ||
429 | LogHeader, actor.LocalID, actor.GetType().Name); | ||
430 | } | ||
422 | } | 431 | } |
423 | 432 | ||
424 | public override void RemovePrim(PhysicsActor prim) | 433 | public override void RemovePrim(PhysicsActor prim) |