Don't allow the last behavior to be removed from a pCampbot bot
If you want to stop existing behavious, add the None behaviour.bullet-2.82
parent
1d2933ca51
commit
3a643e2456
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -628,7 +628,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