aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-09 02:22:22 +0000
committerJustin Clark-Casey (justincc)2012-03-09 02:22:22 +0000
commit73c47f720583da40496d5c8fe94f35ed0aec640f (patch)
tree17e2434d4ac2df29e532b844318c378c02b091a2 /OpenSim/Region
parentFireAndForget scripted rez - port from Avination (diff)
downloadopensim-SC-73c47f720583da40496d5c8fe94f35ed0aec640f.zip
opensim-SC-73c47f720583da40496d5c8fe94f35ed0aec640f.tar.gz
opensim-SC-73c47f720583da40496d5c8fe94f35ed0aec640f.tar.bz2
opensim-SC-73c47f720583da40496d5c8fe94f35ed0aec640f.tar.xz
Remove a race condition from SP.Set_AbsolutePosition where we assume the ParentPart is still not null if the ParentID != 0
Another thread could come in and stand the avatar between those two instructions.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9d5cdfa..be56fe1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -455,12 +455,12 @@ namespace OpenSim.Region.Framework.Scenes
455 // in the sim unless the avatar is on a sit target. While 455 // in the sim unless the avatar is on a sit target. While
456 // on a sit target, m_pos will contain the desired offset 456 // on a sit target, m_pos will contain the desired offset
457 // without the parent rotation applied. 457 // without the parent rotation applied.
458 if (ParentID != 0) 458 SceneObjectPart sitPart = ParentPart;
459 { 459
460 SceneObjectPart part = ParentPart; 460 if (sitPart != null)
461 return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); 461 return sitPart.AbsolutePosition + (m_pos * sitPart.GetWorldRotation());
462 }
463 } 462 }
463
464 return m_pos; 464 return m_pos;
465 } 465 }
466 set 466 set