Author: alink
Date: Thu May 1 19:31:35 2008
New Revision: 26286
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26286&view=rev
Log:
Improve alias in command-line:
- now support alias to command+arg
- resolve the alias before displaying error message about the bad command
Modified:
trunk/src/menu_events.cpp
Modified: trunk/src/menu_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=26286&r1=26285&r2=26286&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Thu May 1 19:31:35 2008
@@ -1952,16 +1952,19 @@
//actual work function
void dispatch(std::string cmd)
{
- parse_cmd(cmd);
if (empty()) {
init_map_default();
init_map();
}
+
+ std::string actual_cmd = get_actual_cmd(cmd);
+ parse_cmd(actual_cmd);
+
if (get_cmd().empty()) {
return;
}
- std::string actual_cmd =
get_actual_cmd(get_cmd());
- if (const command* c = get_command(actual_cmd))
{
+
+ if (const command* c = get_command(get_cmd())) {
if (is_enabled(*c)) {
(static_cast<Worker*>(this)->*(c->handler))();
} else {
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits