From 5f500c89ce9df27910fa6007d4d87aa238a8a2ba Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 1 Aug 2012 22:30:34 +0100 Subject: Fix a bug in pCampbot grabbing behaviour where an exception would be thrown if the bot was not yet aware of any objects. --- OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tools/pCampBot') diff --git a/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs index 701881e..66a336a 100644 --- a/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs +++ b/OpenSim/Tools/pCampBot/Behaviours/GrabbingBehaviour.cs @@ -47,6 +47,9 @@ namespace pCampBot { Dictionary objects = Bot.Objects; + if (objects.Count <= 0) + return; + Primitive prim = objects.ElementAt(Bot.Random.Next(0, objects.Count - 1)).Value; // This appears to be a typical message sent when a viewer user clicks a clickable object -- cgit v1.1