mail[Wesnoth-commits] r33764 - in /trunk: changelog src/mapgen.hpp src/mapgen_dialog.cpp src/playmp_controller.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by soliton . de on March 17, 2009 - 19:14:
Author: soliton
Date: Tue Mar 17 19:14:46 2009
New Revision: 33764

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33764&view=rev
Log:
Revert "Fixes bug #13198 (corrupt replay in hotseat MP). It was caused by 
revision 31665 and probably fixes the first remaining issue of that 
("[end_turn] currently breaks replays"), since it removes double recording of 
[end_turn] if the time limit is hit."

Modified:
    trunk/changelog
    trunk/src/mapgen.hpp
    trunk/src/mapgen_dialog.cpp
    trunk/src/playmp_controller.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33764&r1=33763&r2=33764&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Mar 17 19:14:46 2009
@@ -7,7 +7,6 @@
    * Increase the map size limit to 1000 by 1000
  * Miscellaneous and bug fixes:
    * Fixed bug #13204: NR: Death event doesn't re-spawn Malifor as expected
-   * Fixed bug #13198: Corrupt replay in MP
 
 Version 1.5.14:
  * Campaigns:

Modified: trunk/src/mapgen.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mapgen.hpp?rev=33764&r1=33763&r2=33764&view=diff
==============================================================================
--- trunk/src/mapgen.hpp (original)
+++ trunk/src/mapgen.hpp Tue Mar 17 19:14:46 2009
@@ -25,17 +25,6 @@
 #include <map>
 #include <string>
 #include <vector>
-
-struct mapgen_exception : public std::exception
-{
-       mapgen_exception(const std::string& msg)
-       : msg(msg)
-       {
-       }
-       ~mapgen_exception() throw() {}
-       const char* what() const throw() { return msg.c_str(); }
-       const std::string msg;
-};
 
 class map_generator
 {

Modified: trunk/src/mapgen_dialog.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mapgen_dialog.cpp?rev=33764&r1=33763&r2=33764&view=diff
==============================================================================
--- trunk/src/mapgen_dialog.cpp (original)
+++ trunk/src/mapgen_dialog.cpp Tue Mar 17 19:14:46 2009
@@ -339,12 +339,7 @@
 
 std::string default_map_generator::create_map(const 
std::vector<std::string>& args)
 {
-       try{
-               return generate_map(args);
-       }
-       catch (mapgen_exception){
-               return "";
-       }
+       return generate_map(args);
 }
 
 std::string default_map_generator::generate_map(const 
std::vector<std::string>& /*args*/, std::map<map_location,std::string>* 
labels)
@@ -381,29 +376,18 @@
        // Keep a copy of labels as it can be written to by the map generator 
func
        std::map<map_location,std::string> labels_copy;
        int tries = 10;
-       std::string error_message;
        do {
                if (labels) {
                                labels_copy = *labels;
                }
-               try{
-                       map = default_generate_map(width_, height_, 
island_size, island_off_center,
-                               iterations, hill_size_, max_lakes, 
(nvillages_ * width_ * height_) / 1000,
-                               castle_size_, nplayers_, link_castles_, 
labels, cfg_);
-                       error_message = "";
-               }
-               catch (mapgen_exception& exc){
-                       error_message = exc.msg;
-               }
+               map = default_generate_map(width_, height_, island_size, 
island_off_center,
+                       iterations, hill_size_, max_lakes, (nvillages_ * 
width_ * height_) / 1000,
+                       castle_size_, nplayers_, link_castles_, labels, cfg_);
                --tries;
        } while (tries && map.empty());
        if (labels) {
                labels->swap(labels_copy);
        }
-
-       if (error_message != "")
-               throw mapgen_exception(error_message);
-
        return map;
 }
 
@@ -421,13 +405,7 @@
 
        std::map<map_location,std::string> labels;
        DBG_NG << "generating map...\n";
-       try{
-               res["map_data"] = generate_map(args,&labels);
-       }
-       catch (mapgen_exception exc){
-               res["map_data"] = "";
-               res["error_message"] = exc.msg;
-       }
+       res["map_data"] = generate_map(args,&labels);
        DBG_NG << "done generating map..\n";
 
        for(std::map<map_location,std::string>::const_iterator i =

Modified: trunk/src/playmp_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playmp_controller.cpp?rev=33764&r1=33763&r2=33764&view=diff
==============================================================================
--- trunk/src/playmp_controller.cpp (original)
+++ trunk/src/playmp_controller.cpp Tue Mar 17 19:14:46 2009
@@ -274,6 +274,8 @@
                                        secs = (secs > maxtime) ? maxtime : 
secs;
                                        
current_team().set_countdown_time(1000 * secs);
                                }
+                               
recorder.add_countdown_update(current_team().countdown_time(),player_number_);
+                               recorder.end_turn();
                                turn_data_->send_data();
 
                                throw end_turn_exception();




Related Messages


Powered by MHonArc, Updated Tue Mar 17 19:20:28 2009