Fix a bug in pCampbot grabbing behaviour where an exception would be thrown if the bot was not yet aware of any objects.
parent
5772d23ff6
commit
08a9b01123
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue