aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs38
1 files changed, 30 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 9c62775..d235bac 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -734,7 +734,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
734 ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); 734 ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false);
735 735
736 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 736 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
737 wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); 737 if (wComm != null)
738 wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
738 } 739 }
739 740
740 public void llSay(int channelID, string text) 741 public void llSay(int channelID, string text)
@@ -754,7 +755,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
754 ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); 755 ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false);
755 756
756 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 757 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
757 wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text); 758 if (wComm != null)
759 wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
758 } 760 }
759 } 761 }
760 762
@@ -769,7 +771,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
769 ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); 771 ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true);
770 772
771 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 773 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
772 wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text); 774 if (wComm != null)
775 wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text);
773 } 776 }
774 777
775 public void llRegionSay(int channelID, string text) 778 public void llRegionSay(int channelID, string text)
@@ -786,7 +789,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
786 m_host.AddScriptLPS(1); 789 m_host.AddScriptLPS(1);
787 790
788 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 791 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
789 wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); 792 if (wComm != null)
793 wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text);
790 } 794 }
791 795
792 public LSL_Integer llListen(int channelID, string name, string ID, string msg) 796 public LSL_Integer llListen(int channelID, string name, string ID, string msg)
@@ -795,21 +799,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
795 UUID keyID; 799 UUID keyID;
796 UUID.TryParse(ID, out keyID); 800 UUID.TryParse(ID, out keyID);
797 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 801 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
798 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); 802 if (wComm != null)
803 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg);
804 else
805 return -1;
799 } 806 }
800 807
801 public void llListenControl(int number, int active) 808 public void llListenControl(int number, int active)
802 { 809 {
803 m_host.AddScriptLPS(1); 810 m_host.AddScriptLPS(1);
804 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 811 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
805 wComm.ListenControl(m_itemID, number, active); 812 if (wComm != null)
813 wComm.ListenControl(m_itemID, number, active);
806 } 814 }
807 815
808 public void llListenRemove(int number) 816 public void llListenRemove(int number)
809 { 817 {
810 m_host.AddScriptLPS(1); 818 m_host.AddScriptLPS(1);
811 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 819 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
812 wComm.ListenRemove(m_itemID, number); 820 if (wComm != null)
821 wComm.ListenRemove(m_itemID, number);
813 } 822 }
814 823
815 public void llSensor(string name, string id, int type, double range, double arc) 824 public void llSensor(string name, string id, int type, double range, double arc)
@@ -1037,7 +1046,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1037 return detectedParams.TouchUV; 1046 return detectedParams.TouchUV;
1038 } 1047 }
1039 1048
1040 public void llDie() 1049 public virtual void llDie()
1041 { 1050 {
1042 m_host.AddScriptLPS(1); 1051 m_host.AddScriptLPS(1);
1043 throw new SelfDeleteException(); 1052 throw new SelfDeleteException();
@@ -1987,6 +1996,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1987 1996
1988//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type 1997//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type
1989// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; 1998// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition;
1999
2000 // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line
2001 // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt
2002 // It's perfectly okay when the object is not an active physical body though.
2003 // So, part.ParentGroup.ResetChildPrimPhysicsPositions(); does the thing that Kitto is warning against
2004 // but only if the object is not physial and active. This is important for rotating doors.
2005 // without the absoluteposition = absoluteposition happening, the doors do not move in the physics
2006 // scene
2007 if (part.PhysActor != null && !part.PhysActor.IsPhysical)
2008 {
2009 part.ParentGroup.ResetChildPrimPhysicsPositions();
2010 }
1990 } 2011 }
1991 2012
1992 /// <summary> 2013 /// <summary>
@@ -5772,6 +5793,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5772 m_host.AddScriptLPS(1); 5793 m_host.AddScriptLPS(1);
5773 return World.SimulatorFPS; 5794 return World.SimulatorFPS;
5774 } 5795 }
5796
5775 5797
5776 /* particle system rules should be coming into this routine as doubles, that is 5798 /* particle system rules should be coming into this routine as doubles, that is
5777 rule[0] should be an integer from this list and rule[1] should be the arg 5799 rule[0] should be an integer from this list and rule[1] should be the arg