From c75508ec8d236b45c65c80d479ed7c24dd3343ce Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 23 Jan 2013 20:29:05 +0100 Subject: Fix a type (Suports => Supports). Also put the normal terrain collision check into the physics check patch for now since physics doesn't properly return land for some reason (as tested by Nebadon) --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0562c7f..703c54d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -12209,7 +12209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL); - if (World.SuportsRayCastFiltered()) + if (World.SupportsRayCastFiltered()) { if (dist == 0) return list; @@ -12272,13 +12272,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - if (checkTerrain) - { - ContactResult? groundContact = GroundIntersection(rayStart, rayEnd); - if (groundContact != null) - results.Add((ContactResult)groundContact); - } - if (checkAgents) { ContactResult[] agentHits = AvatarIntersection(rayStart, rayEnd); @@ -12294,6 +12287,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + if (checkTerrain) + { + ContactResult? groundContact = GroundIntersection(rayStart, rayEnd); + if (groundContact != null) + results.Add((ContactResult)groundContact); + } + results.Sort(delegate(ContactResult a, ContactResult b) { return a.Depth.CompareTo(b.Depth); -- cgit v1.1 From dd6ddcc7a53565cc540def336c5b4bd2307a1d63 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 23 Jan 2013 20:58:47 +0100 Subject: Prevent double ground collisions and prefer the physics result if there is one. ODE is known to not see the ground sometimes on raycast so the double test is needed. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 703c54d..a8763ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -12287,11 +12287,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + // Double check this if (checkTerrain) { - ContactResult? groundContact = GroundIntersection(rayStart, rayEnd); - if (groundContact != null) - results.Add((ContactResult)groundContact); + bool skipGroundCheck = false; + + foreach (ContactResult c in results) + { + if (c.ConsumerID == 0) // Physics gave us a ground collision + skipGroundCheck = true; + } + + if (!skipGroundCheck) + { + ContactResult? groundContact = GroundIntersection(rayStart, rayEnd); + if (groundContact != null) + results.Add((ContactResult)groundContact); + } } results.Sort(delegate(ContactResult a, ContactResult b) -- cgit v1.1 From e785242c49dc5ff9fb64e26086d554a127415dde Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 24 Jan 2013 18:23:39 +0100 Subject: Reintroduce the return value of llGiveMoney. The grid will crash and burn without it. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 +++++++++--------- .../ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 2 +- .../Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a8763ea..4709c0b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3017,19 +3017,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return src.ToLower(); } - public void llGiveMoney(string destination, int amount) + public LSL_Integer llGiveMoney(string destination, int amount) { - Util.FireAndForget(x => - { +// Util.FireAndForget(x => +// { m_host.AddScriptLPS(1); if (m_item.PermsGranter == UUID.Zero) - return; + return 0; if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) { LSLError("No permissions to give money"); - return; + return 0; } UUID toID = new UUID(); @@ -3037,7 +3037,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!UUID.TryParse(destination, out toID)) { LSLError("Bad key in llGiveMoney"); - return; + return 0; } IMoneyModule money = World.RequestModuleInterface(); @@ -3045,12 +3045,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (money == null) { NotImplemented("llGiveMoney"); - return; + return 0; } - money.ObjectGiveMoney( + return money.ObjectGiveMoney( m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); - }); +// }); } public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 8eeb4d2..9bf6f9b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -208,7 +208,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Float llGetWallclock(); void llGiveInventory(string destination, string inventory); void llGiveInventoryList(string destination, string category, LSL_List inventory); - void llGiveMoney(string destination, int amount); + LSL_Integer llGiveMoney(string destination, int amount); LSL_String llTransferLindenDollars(string destination, int amount); void llGodLikeRezObject(string inventory, LSL_Vector pos); LSL_Float llGround(LSL_Vector offset); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index ef71d7b..8ecc4f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -876,9 +876,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_LSL_Functions.llGiveInventoryList(destination, category, inventory); } - public void llGiveMoney(string destination, int amount) + public LSL_Integer llGiveMoney(string destination, int amount) { - m_LSL_Functions.llGiveMoney(destination, amount); + return m_LSL_Functions.llGiveMoney(destination, amount); } public LSL_String llTransferLindenDollars(string destination, int amount) -- cgit v1.1 From 789e9901ddadf8c10a6296225a3fa50197ea43f0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 24 Jan 2013 21:32:25 +0100 Subject: Make llGiveMoney async again. The return value is now the constant 1 to make scripts work properly. Scripts will no longer receive a failure indication through this return value; --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 4709c0b..53c6e5c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3019,17 +3019,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGiveMoney(string destination, int amount) { -// Util.FireAndForget(x => -// { + Util.FireAndForget(x => + { m_host.AddScriptLPS(1); if (m_item.PermsGranter == UUID.Zero) - return 0; + return; if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) { LSLError("No permissions to give money"); - return 0; + return; } UUID toID = new UUID(); @@ -3037,7 +3037,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!UUID.TryParse(destination, out toID)) { LSLError("Bad key in llGiveMoney"); - return 0; + return; } IMoneyModule money = World.RequestModuleInterface(); @@ -3045,12 +3045,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (money == null) { NotImplemented("llGiveMoney"); - return 0; + return; } - return money.ObjectGiveMoney( + money.ObjectGiveMoney( m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); -// }); + }); + + return 0; } public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) -- cgit v1.1