diff options
author | Justin Clark-Casey (justincc) | 2014-08-15 22:43:55 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-08-15 22:44:31 +0100 |
commit | 3a643e24560a8200dd99a855d1cc7ed1d3b4b9c5 (patch) | |
tree | 32bb6a95cc2aa04d5b0b8a275ae4491c2540bc55 /OpenSim | |
parent | Resolve a small race condition on removing bot behaviours that might leave pr... (diff) | |
download | opensim-SC-3a643e24560a8200dd99a855d1cc7ed1d3b4b9c5.zip opensim-SC-3a643e24560a8200dd99a855d1cc7ed1d3b4b9c5.tar.gz opensim-SC-3a643e24560a8200dd99a855d1cc7ed1d3b4b9c5.tar.bz2 opensim-SC-3a643e24560a8200dd99a855d1cc7ed1d3b4b9c5.tar.xz |
Don't allow the last behavior to be removed from a pCampbot bot
If you want to stop existing behavious, add the None behaviour.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tools/pCampBot/Bot.cs | 3 | ||||
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs index c043186..45a6682 100644 --- a/OpenSim/Tools/pCampBot/Bot.cs +++ b/OpenSim/Tools/pCampBot/Bot.cs | |||
@@ -208,6 +208,9 @@ namespace pCampBot | |||
208 | 208 | ||
209 | public bool RemoveBehaviour(string abbreviatedName) | 209 | public bool RemoveBehaviour(string abbreviatedName) |
210 | { | 210 | { |
211 | if (Behaviours.Count <= 0) | ||
212 | return false; | ||
213 | |||
211 | Dictionary<string, IBehaviour> updatedBehaviours = new Dictionary<string, IBehaviour>(Behaviours); | 214 | Dictionary<string, IBehaviour> updatedBehaviours = new Dictionary<string, IBehaviour>(Behaviours); |
212 | IBehaviour behaviour; | 215 | IBehaviour behaviour; |
213 | 216 | ||
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index b199931..b10f552 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -628,7 +628,7 @@ namespace pCampBot | |||
628 | } | 628 | } |
629 | 629 | ||
630 | MainConsole.Instance.OutputFormat( | 630 | MainConsole.Instance.OutputFormat( |
631 | "Removed behaviours {0} to bot {1}", | 631 | "Removed behaviours {0} from bot {1}", |
632 | string.Join(", ", behavioursRemoved.ConvertAll<string>(b => b.Name).ToArray()), bot.Name); | 632 | string.Join(", ", behavioursRemoved.ConvertAll<string>(b => b.Name).ToArray()), bot.Name); |
633 | } | 633 | } |
634 | } | 634 | } |