Improve the previous custom command feature:

...allow sequence of commands like : custom Thief ; unit gender female
; unit hitpoints 100 ; unit name Wonderwoman

Then the hotkey will always create this special unit.

Not very useful with the current set of commands but was easy to
implement.

The main use is probably custom Thief ; unit moves 10
This commit is contained in:
Ali El Gariani 2008-04-30 04:01:23 +00:00
parent 840d1d0642
commit 956d928659

View File

@ -2904,7 +2904,11 @@ private:
void menu_handler::custom_command(mouse_handler& mousehandler, const unsigned int team_num)
{
do_command(preferences::custom_command(), team_num, mousehandler);
std::vector<std::string> commands = utils::split(preferences::custom_command(), ';');
std::vector<std::string>::iterator c = commands.begin();
for (; c != commands.end() ; ++c) {
do_command(*c, team_num, mousehandler);
}
}
void menu_handler::ai_formula()