Author: ilor
Date: Sat May 23 01:09:44 2009
New Revision: 35838
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35838&view=rev
Log:
Catch mapgen errors in editor, fixing bug #13549
Modified:
branches/1.6/src/editor2/editor_controller.cpp
Modified: branches/1.6/src/editor2/editor_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/editor2/editor_controller.cpp?rev=35838&r1=35837&r2=35838&view=diff
==============================================================================
--- branches/1.6/src/editor2/editor_controller.cpp (original)
+++ branches/1.6/src/editor2/editor_controller.cpp Sat May 23 01:09:44 2009
@@ -475,8 +475,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