aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/Bot.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools/pCampBot/Bot.cs')
-rw-r--r--OpenSim/Tools/pCampBot/Bot.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs
index 0bd8151..f871b77 100644
--- a/OpenSim/Tools/pCampBot/Bot.cs
+++ b/OpenSim/Tools/pCampBot/Bot.cs
@@ -209,7 +209,17 @@ namespace pCampBot
209 public bool RemoveBehaviour(string abbreviatedName) 209 public bool RemoveBehaviour(string abbreviatedName)
210 { 210 {
211 lock (Behaviours) 211 lock (Behaviours)
212 return Behaviours.Remove(abbreviatedName); 212 {
213 IBehaviour behaviour;
214
215 if (!Behaviours.TryGetValue(abbreviatedName, out behaviour))
216 return false;
217
218 behaviour.Close();
219 Behaviours.Remove(abbreviatedName);
220
221 return true;
222 }
213 } 223 }
214 224
215 private void CreateLibOmvClient() 225 private void CreateLibOmvClient()
@@ -282,6 +292,10 @@ namespace pCampBot
282 // XXX: This is a really shitty way of yielding so that behaviours can be added/removed 292 // XXX: This is a really shitty way of yielding so that behaviours can be added/removed
283 Thread.Sleep(100); 293 Thread.Sleep(100);
284 } 294 }
295
296 lock (Behaviours)
297 foreach (IBehaviour b in Behaviours.Values)
298 b.Close();
285 } 299 }
286 300
287 /// <summary> 301 /// <summary>