Author: ilor
Date: Sat May 23 01:12:17 2009
New Revision: 35839
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35839&view=rev
Log:
Catch mapgen errors in editor, fixing bug #13549
Modified:
trunk/src/editor2/editor_controller.cpp
Modified: trunk/src/editor2/editor_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=35839&r1=35838&r2=35839&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Sat May 23 01:12:17 2009
@@ -487,8 +487,14 @@
dialog.set_gui(&gui());
dialog.show(gui().video());
if (dialog.get_retval() == gui2::twindow::OK) {
- std::string map_string =
-
dialog.get_selected_map_generator()->create_map(std::vector<std::string>());
+ std::string map_string;
+ try {
+ map_string = dialog.get_selected_map_generator()
+ ->create_map(std::vector<std::string>());
+ } catch (mapgen_exception& e) {
+ gui::message_dialog(gui(), _("Map creation failed."),
e.what()).show();
+ return;
+ }
if (map_string.empty()) {
gui::message_dialog(gui(), "", _("Map creation
failed.")).show();
} else {
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits