diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 58c2ac5..0562c7f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3017,42 +3017,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3017 | return src.ToLower(); | 3017 | return src.ToLower(); |
3018 | } | 3018 | } |
3019 | 3019 | ||
3020 | public LSL_Integer llGiveMoney(string destination, int amount) | 3020 | public void llGiveMoney(string destination, int amount) |
3021 | { | 3021 | { |
3022 | m_host.AddScriptLPS(1); | 3022 | Util.FireAndForget(x => |
3023 | |||
3024 | if (m_item.PermsGranter == UUID.Zero) | ||
3025 | return 0; | ||
3026 | |||
3027 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) | ||
3028 | { | 3023 | { |
3029 | LSLError("No permissions to give money"); | 3024 | m_host.AddScriptLPS(1); |
3030 | return 0; | ||
3031 | } | ||
3032 | 3025 | ||
3033 | UUID toID = new UUID(); | 3026 | if (m_item.PermsGranter == UUID.Zero) |
3027 | return; | ||
3034 | 3028 | ||
3035 | if (!UUID.TryParse(destination, out toID)) | 3029 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) |
3036 | { | 3030 | { |
3037 | LSLError("Bad key in llGiveMoney"); | 3031 | LSLError("No permissions to give money"); |
3038 | return 0; | 3032 | return; |
3039 | } | 3033 | } |
3040 | 3034 | ||
3041 | IMoneyModule money = World.RequestModuleInterface<IMoneyModule>(); | 3035 | UUID toID = new UUID(); |
3042 | 3036 | ||
3043 | if (money == null) | 3037 | if (!UUID.TryParse(destination, out toID)) |
3044 | { | 3038 | { |
3045 | NotImplemented("llGiveMoney"); | 3039 | LSLError("Bad key in llGiveMoney"); |
3046 | return 0; | 3040 | return; |
3047 | } | 3041 | } |
3048 | 3042 | ||
3049 | bool result = money.ObjectGiveMoney( | 3043 | IMoneyModule money = World.RequestModuleInterface<IMoneyModule>(); |
3050 | m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); | ||
3051 | 3044 | ||
3052 | if (result) | 3045 | if (money == null) |
3053 | return 1; | 3046 | { |
3047 | NotImplemented("llGiveMoney"); | ||
3048 | return; | ||
3049 | } | ||
3054 | 3050 | ||
3055 | return 0; | 3051 | money.ObjectGiveMoney( |
3052 | m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); | ||
3053 | }); | ||
3056 | } | 3054 | } |
3057 | 3055 | ||
3058 | public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) | 3056 | public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) |
@@ -12589,7 +12587,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
12589 | } | 12587 | } |
12590 | 12588 | ||
12591 | bool result = money.ObjectGiveMoney( | 12589 | bool result = money.ObjectGiveMoney( |
12592 | m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); | 12590 | m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn); |
12593 | 12591 | ||
12594 | if (result) | 12592 | if (result) |
12595 | { | 12593 | { |