aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-17 15:40:27 +0000
committerJustin Clarke Casey2008-11-17 15:40:27 +0000
commitd54b6608a7acfa7fc9fd074f2fbd241519067fcb (patch)
tree4fb604c6b80f0e67d9ea8e884941386a9a4d6a4f /OpenSim/Region/ScriptEngine
parentfixing warnings in YProlog language support (diff)
downloadopensim-SC_OLD-d54b6608a7acfa7fc9fd074f2fbd241519067fcb.zip
opensim-SC_OLD-d54b6608a7acfa7fc9fd074f2fbd241519067fcb.tar.gz
opensim-SC_OLD-d54b6608a7acfa7fc9fd074f2fbd241519067fcb.tar.bz2
opensim-SC_OLD-d54b6608a7acfa7fc9fd074f2fbd241519067fcb.tar.xz
* Stop nulling SOG.m_rootPart and parts on object deletion
* This renders RootPart == null checks useless - the replacement is to check SOG.IsDeleted. However, in many cases this will not be necessary since updates to deleted parts will not be sent to the client * This should remove any remaining race conditions where an object is deleted while another thread is yet to obtain the root part to perform some operation * Doing this is probably a necessary prerequisite to moving to a model without a separate SOG and SOP * Unfortunately it's not possible to eliminate all RootPart == null checks since in some contexts it is currently used to check whether an object was created successfully
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b189ffd..f8e9e96 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1145,7 +1145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1145 { 1145 {
1146 // TODO: this needs to trigger a persistance save as well 1146 // TODO: this needs to trigger a persistance save as well
1147 1147
1148 if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) 1148 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
1149 return; 1149 return;
1150 1150
1151 if (scale.x < 0.01 || scale.y < 0.01 || scale.z < 0.01) 1151 if (scale.x < 0.01 || scale.y < 0.01 || scale.z < 0.01)
@@ -1859,7 +1859,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1859 1859
1860 if (m_host.ParentGroup != null) 1860 if (m_host.ParentGroup != null)
1861 { 1861 {
1862 if (m_host.ParentGroup.RootPart != null) 1862 if (!m_host.ParentGroup.IsDeleted)
1863 { 1863 {
1864 if (local != 0) 1864 if (local != 0)
1865 force *= llGetRot(); 1865 force *= llGetRot();
@@ -1877,7 +1877,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1877 1877
1878 if (m_host.ParentGroup != null) 1878 if (m_host.ParentGroup != null)
1879 { 1879 {
1880 if (m_host.ParentGroup.RootPart != null) 1880 if (!m_host.ParentGroup.IsDeleted)
1881 { 1881 {
1882 PhysicsVector tmpForce = m_host.ParentGroup.RootPart.GetForce(); 1882 PhysicsVector tmpForce = m_host.ParentGroup.RootPart.GetForce();
1883 force.x = tmpForce.X; 1883 force.x = tmpForce.X;
@@ -2701,7 +2701,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2701 m_host.AddScriptLPS(1); 2701 m_host.AddScriptLPS(1);
2702 if (m_host.ParentGroup != null) 2702 if (m_host.ParentGroup != null)
2703 { 2703 {
2704 if (m_host.ParentGroup.RootPart != null) 2704 if (!m_host.ParentGroup.IsDeleted)
2705 { 2705 {
2706 m_host.ParentGroup.RootPart.SetBuoyancy((float)buoyancy); 2706 m_host.ParentGroup.RootPart.SetBuoyancy((float)buoyancy);
2707 } 2707 }
@@ -5473,7 +5473,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5473 m_host.AddScriptLPS(1); 5473 m_host.AddScriptLPS(1);
5474 if (m_host.ParentGroup != null) 5474 if (m_host.ParentGroup != null)
5475 { 5475 {
5476 if (m_host.ParentGroup.RootPart != null) 5476 if (!m_host.ParentGroup.IsDeleted)
5477 { 5477 {
5478 m_host.ParentGroup.RootPart.SetVehicleType(type); 5478 m_host.ParentGroup.RootPart.SetVehicleType(type);
5479 } 5479 }
@@ -5488,7 +5488,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5488 5488
5489 if (m_host.ParentGroup != null) 5489 if (m_host.ParentGroup != null)
5490 { 5490 {
5491 if (m_host.ParentGroup.RootPart != null) 5491 if (!m_host.ParentGroup.IsDeleted)
5492 { 5492 {
5493 m_host.ParentGroup.RootPart.SetVehicleFloatParam(param, (float)value); 5493 m_host.ParentGroup.RootPart.SetVehicleFloatParam(param, (float)value);
5494 } 5494 }
@@ -5502,7 +5502,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5502 m_host.AddScriptLPS(1); 5502 m_host.AddScriptLPS(1);
5503 if (m_host.ParentGroup != null) 5503 if (m_host.ParentGroup != null)
5504 { 5504 {
5505 if (m_host.ParentGroup.RootPart != null) 5505 if (!m_host.ParentGroup.IsDeleted)
5506 { 5506 {
5507 m_host.ParentGroup.RootPart.SetVehicleVectorParam(param, 5507 m_host.ParentGroup.RootPart.SetVehicleVectorParam(param,
5508 new PhysicsVector((float)vec.x, (float)vec.y, (float)vec.z) ); 5508 new PhysicsVector((float)vec.x, (float)vec.y, (float)vec.z) );
@@ -5517,7 +5517,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5517 m_host.AddScriptLPS(1); 5517 m_host.AddScriptLPS(1);
5518 if (m_host.ParentGroup != null) 5518 if (m_host.ParentGroup != null)
5519 { 5519 {
5520 if (m_host.ParentGroup.RootPart != null) 5520 if (!m_host.ParentGroup.IsDeleted)
5521 { 5521 {
5522 m_host.ParentGroup.RootPart.SetVehicleRotationParam(param, 5522 m_host.ParentGroup.RootPart.SetVehicleRotationParam(param,
5523 Rot2Quaternion(rot)); 5523 Rot2Quaternion(rot));