diff options
author | Melanie Thielker | 2008-12-16 04:12:40 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-12-16 04:12:40 +0000 |
commit | 36ee0e8fb9309d33b5003f936e8935a3c368b7e0 (patch) | |
tree | c0d3193b6a7f545aea943ed3d1b1b87946e2d19b /OpenSim/Region/Environment | |
parent | Attempt at fixing the HG home jump by looking up hyperlink regions before gri... (diff) | |
download | opensim-SC-36ee0e8fb9309d33b5003f936e8935a3c368b7e0.zip opensim-SC-36ee0e8fb9309d33b5003f936e8935a3c368b7e0.tar.gz opensim-SC-36ee0e8fb9309d33b5003f936e8935a3c368b7e0.tar.bz2 opensim-SC-36ee0e8fb9309d33b5003f936e8935a3c368b7e0.tar.xz |
Fix script controls for weapons
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 4668dae..c0779f2 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -45,7 +45,7 @@ using OSD = OpenMetaverse.StructuredData.OSD; | |||
45 | 45 | ||
46 | namespace OpenSim.Region.Environment.Scenes | 46 | namespace OpenSim.Region.Environment.Scenes |
47 | { | 47 | { |
48 | enum ScriptControlled : int | 48 | enum ScriptControlled : uint |
49 | { | 49 | { |
50 | CONTROL_ZERO = 0, | 50 | CONTROL_ZERO = 0, |
51 | CONTROL_FWD = 1, | 51 | CONTROL_FWD = 1, |
@@ -85,6 +85,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
85 | private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>(); | 85 | private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>(); |
86 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; | 86 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; |
87 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; | 87 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; |
88 | private bool MouseDown = false; | ||
88 | private SceneObjectGroup proxyObjectGroup = null; | 89 | private SceneObjectGroup proxyObjectGroup = null; |
89 | //private SceneObjectPart proxyObjectPart = null; | 90 | //private SceneObjectPart proxyObjectPart = null; |
90 | 91 | ||
@@ -3341,6 +3342,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
3341 | 3342 | ||
3342 | ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; | 3343 | ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; |
3343 | 3344 | ||
3345 | if (MouseDown) | ||
3346 | { | ||
3347 | allflags = LastCommands & (ScriptControlled.CONTROL_ML_LBUTTON | ScriptControlled.CONTROL_LBUTTON); | ||
3348 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_UP) != 0 || (flags & unchecked((uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_UP)) != 0) | ||
3349 | { | ||
3350 | allflags = ScriptControlled.CONTROL_ZERO; | ||
3351 | MouseDown = true; | ||
3352 | } | ||
3353 | } | ||
3354 | |||
3355 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_DOWN) != 0) | ||
3356 | { | ||
3357 | allflags |= ScriptControlled.CONTROL_ML_LBUTTON; | ||
3358 | MouseDown = true; | ||
3359 | } | ||
3360 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0) | ||
3361 | { | ||
3362 | allflags |= ScriptControlled.CONTROL_LBUTTON; | ||
3363 | MouseDown = true; | ||
3364 | } | ||
3365 | |||
3344 | // find all activated controls, whether the scripts are interested in them or not | 3366 | // find all activated controls, whether the scripts are interested in them or not |
3345 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) | 3367 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) |
3346 | { | 3368 | { |
@@ -3374,15 +3396,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
3374 | { | 3396 | { |
3375 | allflags |= ScriptControlled.CONTROL_ROT_LEFT; | 3397 | allflags |= ScriptControlled.CONTROL_ROT_LEFT; |
3376 | } | 3398 | } |
3377 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_DOWN) != 0) | ||
3378 | { | ||
3379 | allflags |= ScriptControlled.CONTROL_ML_LBUTTON; | ||
3380 | } | ||
3381 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_UP) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0) | ||
3382 | { | ||
3383 | allflags |= ScriptControlled.CONTROL_LBUTTON; | ||
3384 | } | ||
3385 | |||
3386 | // optimization; we have to check per script, but if nothing is pressed and nothing changed, we can skip that | 3399 | // optimization; we have to check per script, but if nothing is pressed and nothing changed, we can skip that |
3387 | if (allflags != ScriptControlled.CONTROL_ZERO || allflags != LastCommands) | 3400 | if (allflags != ScriptControlled.CONTROL_ZERO || allflags != LastCommands) |
3388 | { | 3401 | { |