diff --git a/libsecondlife/AgentManager.cs b/libsecondlife/AgentManager.cs index 18b65068..4dbe7c79 100644 --- a/libsecondlife/AgentManager.cs +++ b/libsecondlife/AgentManager.cs @@ -1648,51 +1648,6 @@ namespace libsecondlife } } - /// - /// Aims at the specified position, enters mouselook, presses and - /// releases the left mouse button, and leaves mouselook - /// - /// Target to shoot at - /// - public bool Shoot(LLVector3 target) - { - if (Movement.TurnToward(target)) - return Shoot(); - else - return false; - } - - /// - /// Enters mouselook, presses and releases the left mouse button, and leaves mouselook - /// - /// - public bool Shoot() - { - if (Client.Settings.SEND_AGENT_UPDATES) - { - Movement.Mouselook = true; - Movement.MLButtonDown = true; - Movement.SendUpdate(); - - Movement.MLButtonUp = true; - Movement.MLButtonDown = false; - Movement.FinishAnim = true; - Movement.SendUpdate(); - - Movement.Mouselook = false; - Movement.MLButtonUp = false; - Movement.FinishAnim = false; - Movement.SendUpdate(); - - return true; - } - else - { - Client.Log("Attempted Shoot but agent updates are disabled", Helpers.LogLevel.Warning); - return false; - } - } - #endregion Movement actions #region Touch and grab diff --git a/libsecondlife/AgentManagerMovement.cs b/libsecondlife/AgentManagerMovement.cs index cbc9837b..12c8d85a 100644 --- a/libsecondlife/AgentManagerMovement.cs +++ b/libsecondlife/AgentManagerMovement.cs @@ -520,7 +520,7 @@ namespace libsecondlife /// /// Target to shoot at /// - [Obsolete("Use Self.Shoot()")] + [Obsolete("Moved to libsecondlife.Utilities")] public bool Shoot(LLVector3 target) { if (TurnToward(target)) @@ -533,7 +533,7 @@ namespace libsecondlife /// Enters mouselook, presses and releases the left mouse button, and leaves mouselook /// /// - [Obsolete("Use Self.Shoot()")] + [Obsolete("Moved to libsecondlife.Utilities")] public bool Shoot() { if (Client.Settings.SEND_AGENT_UPDATES) diff --git a/libsecondlife/libsecondlife.Utilities/Utilities.cs b/libsecondlife/libsecondlife.Utilities/Utilities.cs index 1cc172e6..764ff4dc 100644 --- a/libsecondlife/libsecondlife.Utilities/Utilities.cs +++ b/libsecondlife/libsecondlife.Utilities/Utilities.cs @@ -24,6 +24,51 @@ namespace libsecondlife.Utilities public static class Realism { + /// + /// Aims at the specified position, enters mouselook, presses and + /// releases the left mouse button, and leaves mouselook + /// + /// Target to shoot at + /// + public static bool Shoot(SecondLife client, LLVector3 target) + { + if (client.Self.Movement.TurnToward(target)) + return Shoot(client); + else + return false; + } + + /// + /// Enters mouselook, presses and releases the left mouse button, and leaves mouselook + /// + /// + public static bool Shoot(SecondLife client) + { + if (client.Settings.SEND_AGENT_UPDATES) + { + client.Self.Movement.Mouselook = true; + client.Self.Movement.MLButtonDown = true; + client.Self.Movement.SendUpdate(); + + client.Self.Movement.MLButtonUp = true; + client.Self.Movement.MLButtonDown = false; + client.Self.Movement.FinishAnim = true; + client.Self.Movement.SendUpdate(); + + client.Self.Movement.Mouselook = false; + client.Self.Movement.MLButtonUp = false; + client.Self.Movement.FinishAnim = false; + client.Self.Movement.SendUpdate(); + + return true; + } + else + { + client.Log("Attempted Shoot but agent updates are disabled", Helpers.LogLevel.Warning); + return false; + } + } + /// /// A psuedo-realistic chat function that uses the typing sound and /// animation, types at three characters per second, and randomly