Author: alink
Date: Fri Jun 13 04:47:34 2008
New Revision: 27140

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27140&view=rev
Log:
Restore the previous behavior for the debug command "unit" (lost in r25875)
now it's again "unit variable=value" instead of "unit variable value"
Also add more flexibility by removing surrounding spaces
(useful for continuing to support passing parameters to aliased commands)

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=27140&r1=27139&r2=27140&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Fri Jun 13 04:47:34 2008
@@ -2893,9 +2893,15 @@
                        return;
                const unit_map::iterator i = 
menu_handler_.current_unit(mouse_handler_);
                if (i == menu_handler_.units_.end()) return;
-               const std::string name = get_arg(1);
-               const std::string value = get_data(2);
-               if (value.empty()) return;
+               const std::string data = get_data(1);
+               std::vector<std::string> parameters = utils::split(data, '=',
+                       utils::REMOVE_EMPTY | utils::STRIP_SPACES);
+               if (parameters.size() < 2)
+                       return;
+               
+               const std::string& name = parameters[0];
+               const std::string& value = parameters[1];
+
                // FIXME: Avoids a core dump on display
                // because alignment strings get reduced
                // to an enum, then used to index an


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to