Fix a bug in pCampbot grabbing behaviour where an exception would be thrown if the bot was not yet aware of any objects.

0.7.3-extended
Justin Clark-Casey (justincc) 2012-08-01 22:30:34 +01:00
parent 5772d23ff6
commit 08a9b01123
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ namespace pCampBot
{
Dictionary<UUID, Primitive> 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