Don't allow the last behavior to be removed from a pCampbot bot
If you want to stop existing behavious, add the None behaviour.0.8-extended
parent
940c79a66d
commit
d0ed6ed86e
|
@ -208,6 +208,9 @@ namespace pCampBot
|
||||||
|
|
||||||
public bool RemoveBehaviour(string abbreviatedName)
|
public bool RemoveBehaviour(string abbreviatedName)
|
||||||
{
|
{
|
||||||
|
if (Behaviours.Count <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
Dictionary<string, IBehaviour> updatedBehaviours = new Dictionary<string, IBehaviour>(Behaviours);
|
Dictionary<string, IBehaviour> updatedBehaviours = new Dictionary<string, IBehaviour>(Behaviours);
|
||||||
IBehaviour behaviour;
|
IBehaviour behaviour;
|
||||||
|
|
||||||
|
|
|
@ -604,7 +604,7 @@ namespace pCampBot
|
||||||
}
|
}
|
||||||
|
|
||||||
MainConsole.Instance.OutputFormat(
|
MainConsole.Instance.OutputFormat(
|
||||||
"Removed behaviours {0} to bot {1}",
|
"Removed behaviours {0} from bot {1}",
|
||||||
string.Join(", ", behavioursRemoved.ConvertAll<string>(b => b.Name).ToArray()), bot.Name);
|
string.Join(", ", behavioursRemoved.ConvertAll<string>(b => b.Name).ToArray()), bot.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue