Author: alink
Date: Wed Mar 26 23:07:27 2008
New Revision: 25173

URL: http://svn.gna.org/viewcvs/wesnoth?rev=25173&view=rev
Log:
Fix a misleading error message, if map was empty (random map genaration fail),
we only give the proper warning when placing leader not units (and so returned
an "invalid position" in the later case). Now directly abort if no map.
Thanks to mihoshi to have provided a test case for this (patch #11380)

Modified:
    trunk/src/config_adapter.cpp

Modified: trunk/src/config_adapter.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config_adapter.cpp?rev=25173&r1=25172&r2=25173&view=diff
==============================================================================
--- trunk/src/config_adapter.cpp (original)
+++ trunk/src/config_adapter.cpp Wed Mar 26 23:07:27 2008
@@ -58,6 +58,10 @@
                                         gamestatus& game_status, bool 
snapshot, bool replay)
 {
        player_info *player = NULL;
+
+       if(map.empty()) {
+               throw game::load_game_failed("Map not found");
+       }
 
        if(cfg["controller"] == "human" ||
           cfg["controller"] == "network" ||
@@ -134,9 +138,6 @@
                // Otherwise start it at the map-given starting position.
                gamemap::location start_pos(cfg, &gamestate);
 
-               if(map.empty()) {
-                       throw game::load_game_failed("Map not found");
-               }
                if(cfg["x"].empty() && cfg["y"].empty()) {
                        start_pos = map.starting_position(side);
                }


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

Reply via email to