From 956d92865947fde89bf0f7ae3f26683d4d3adb9f Mon Sep 17 00:00:00 2001 From: Ali El Gariani Date: Wed, 30 Apr 2008 04:01:23 +0000 Subject: [PATCH] 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 --- src/menu_events.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/menu_events.cpp b/src/menu_events.cpp index 9c942c8ca6a..60e969dd6f7 100644 --- a/src/menu_events.cpp +++ b/src/menu_events.cpp @@ -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 commands = utils::split(preferences::custom_command(), ';'); + std::vector::iterator c = commands.begin(); + for (; c != commands.end() ; ++c) { + do_command(*c, team_num, mousehandler); + } } void menu_handler::ai_formula()