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.4.1
Justin Clark-Casey (justincc) 2012-08-01 22:30:34 +01:00
parent 69a5beeabc
commit 5f500c89ce
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ namespace pCampBot
{ {
Dictionary<UUID, Primitive> objects = Bot.Objects; Dictionary<UUID, Primitive> objects = Bot.Objects;
if (objects.Count <= 0)
return;
Primitive prim = objects.ElementAt(Bot.Random.Next(0, objects.Count - 1)).Value; 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 // This appears to be a typical message sent when a viewer user clicks a clickable object