mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
On pCampBot, add bot as a property on behaviours instead of passing it in every time
This commit is contained in:
@@ -39,20 +39,20 @@ namespace pCampBot
|
||||
/// <remarks>
|
||||
/// The viewer itself does not give the option of grabbing objects that haven't been signalled as grabbable.
|
||||
/// </remarks>
|
||||
public class GrabbingBehaviour : IBehaviour
|
||||
public class GrabbingBehaviour : AbstractBehaviour
|
||||
{
|
||||
public string Name { get { return "Grabbing"; } }
|
||||
public GrabbingBehaviour() { Name = "Grabbing"; }
|
||||
|
||||
public void Action(Bot bot)
|
||||
public override void Action()
|
||||
{
|
||||
Dictionary<UUID, Primitive> objects = bot.Objects;
|
||||
Dictionary<UUID, Primitive> objects = Bot.Objects;
|
||||
|
||||
Primitive prim = objects.ElementAt(bot.Random.Next(0, objects.Count)).Value;
|
||||
Primitive prim = objects.ElementAt(Bot.Random.Next(0, objects.Count)).Value;
|
||||
|
||||
// This appears to be a typical message sent when a viewer user clicks a clickable object
|
||||
bot.Client.Self.Grab(prim.LocalID);
|
||||
bot.Client.Self.GrabUpdate(prim.ID, Vector3.Zero);
|
||||
bot.Client.Self.DeGrab(prim.LocalID);
|
||||
Bot.Client.Self.Grab(prim.LocalID);
|
||||
Bot.Client.Self.GrabUpdate(prim.ID, Vector3.Zero);
|
||||
Bot.Client.Self.DeGrab(prim.LocalID);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user