diff options
author | Teravus Ovares | 2008-05-07 18:23:46 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-07 18:23:46 +0000 |
commit | ab5556055e6104d3e5c18faf7f6f9e44b518839f (patch) | |
tree | 470dfe3c97a2cae75e85853a898f59a8d96548bd /OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |
parent | while I'm not convinced this is causing my current run away (diff) | |
download | opensim-SC-ab5556055e6104d3e5c18faf7f6f9e44b518839f.zip opensim-SC-ab5556055e6104d3e5c18faf7f6f9e44b518839f.tar.gz opensim-SC-ab5556055e6104d3e5c18faf7f6f9e44b518839f.tar.bz2 opensim-SC-ab5556055e6104d3e5c18faf7f6f9e44b518839f.tar.xz |
* Theoretically, everything is in place for scripted take controls... Theoretically.
* I've still got to test, it's still theoretical code :D. Good thing it isn't enabled by default!
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index e8e4f80..1f23d00 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -1936,25 +1936,53 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1936 | 1936 | ||
1937 | public void llTakeControls(int controls, int accept, int pass_on) | 1937 | public void llTakeControls(int controls, int accept, int pass_on) |
1938 | { | 1938 | { |
1939 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
1940 | { | ||
1941 | return; | ||
1942 | } | ||
1943 | |||
1939 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) | 1944 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) |
1940 | { | 1945 | { |
1941 | 1946 | ||
1942 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; | 1947 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; |
1943 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) | 1948 | if (presence != null) |
1944 | { | 1949 | { |
1945 | presence.SendMovementEventsToScript(controls, accept, pass_on, m_localID, m_itemID); | 1950 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) |
1951 | { | ||
1952 | presence.RegisterControlEventsToScript(controls, accept, pass_on, m_localID, m_itemID); | ||
1946 | 1953 | ||
1954 | } | ||
1947 | } | 1955 | } |
1948 | } | 1956 | } |
1949 | 1957 | ||
1950 | m_host.AddScriptLPS(1); | 1958 | m_host.AddScriptLPS(1); |
1951 | NotImplemented("llTakeControls"); | 1959 | //NotImplemented("llTakeControls"); |
1952 | } | 1960 | } |
1953 | 1961 | ||
1954 | public void llReleaseControls() | 1962 | public void llReleaseControls() |
1955 | { | 1963 | { |
1956 | m_host.AddScriptLPS(1); | 1964 | m_host.AddScriptLPS(1); |
1957 | NotImplemented("llReleaseControls"); | 1965 | |
1966 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
1967 | { | ||
1968 | return; | ||
1969 | } | ||
1970 | |||
1971 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) | ||
1972 | { | ||
1973 | |||
1974 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; | ||
1975 | if (presence != null) | ||
1976 | { | ||
1977 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) | ||
1978 | { | ||
1979 | // Unregister controls from Presence | ||
1980 | presence.UnRegisterControlEventsToScript(m_localID, m_itemID); | ||
1981 | // Remove Take Control permission. | ||
1982 | m_host.TaskInventory[InventorySelf()].PermsMask &= ~BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS; | ||
1983 | } | ||
1984 | } | ||
1985 | } | ||
1958 | } | 1986 | } |
1959 | 1987 | ||
1960 | public void llAttachToAvatar(int attachment) | 1988 | public void llAttachToAvatar(int attachment) |