wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src mapgen.cpp mapgen_dialog.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src mapgen.cpp mapgen_dialog.cpp
Date: Sat, 09 Apr 2005 16:24:05 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/04/09 20:24:05

Modified files:
        src            : mapgen.cpp mapgen_dialog.cpp 

Log message:
        Fix bug #11152: villages without name. There was a discrepancy about 
the map width: not every parts of the game agreed on which villages were or not 
on the map.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/mapgen.cpp.diff?tr1=1.61&tr2=1.62&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/mapgen_dialog.cpp.diff?tr1=1.35&tr2=1.36&r1=text&r2=text

Patches:
Index: wesnoth/src/mapgen.cpp
diff -u wesnoth/src/mapgen.cpp:1.61 wesnoth/src/mapgen.cpp:1.62
--- wesnoth/src/mapgen.cpp:1.61 Sun Mar 27 23:06:17 2005
+++ wesnoth/src/mapgen.cpp      Sat Apr  9 20:24:05 2005
@@ -18,6 +18,7 @@
 #include "race.hpp"
 #include "scoped_resource.hpp"
 #include "util.hpp"
+#include "wassert.hpp"
 #include "serialization/string_utils.hpp"
 
 #define ERR_CF LOG_STREAM(err, config)
@@ -606,10 +607,8 @@
 {
        log_scope("map generation");
 
-       //odd widths are nasty, so make them even
-       if(is_odd(width)) {
-               ++width;
-       }
+       //odd widths are nasty
+       wassert(is_even(width));
 
        int ticks = SDL_GetTicks();
 
Index: wesnoth/src/mapgen_dialog.cpp
diff -u wesnoth/src/mapgen_dialog.cpp:1.35 wesnoth/src/mapgen_dialog.cpp:1.36
--- wesnoth/src/mapgen_dialog.cpp:1.35  Fri Mar 18 21:21:48 2005
+++ wesnoth/src/mapgen_dialog.cpp       Sat Apr  9 20:24:05 2005
@@ -280,6 +280,10 @@
 
 std::string default_map_generator::generate_map(const 
std::vector<std::string>& args, std::map<gamemap::location,std::string>* labels)
 {
+       // the random generator thinks odd widths are nasty, so make them even
+       if (is_odd(width_))
+               ++width_;
+
        size_t iterations = 
(iterations_*width_*height_)/(default_width_*default_height_);
        size_t island_size = 0;
        size_t island_off_center = 0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]