[[Editor crash fix]]
* Fixed a bug, when two dimensions of a map were modified, the editor could crash. Problem spotted by Ivanovic. * Cleaned up the map code, making some members private again. * Fixed a typo in players_changelog.
This commit is contained in:
parent
6c7fd7656e
commit
d314b376a4
5 changed files with 24 additions and 9 deletions
|
@ -19,6 +19,9 @@ Version 1.3.9+svn:
|
|||
* language and i18n:
|
||||
* updated translations: Czech, Danish, Finnish, French, Galician, Greek,
|
||||
Hungarian, Italian, Polish, Swedish, Valencian
|
||||
* map editor:
|
||||
* fixed a bug when two dimensions of a map were modified, the editor
|
||||
could crash
|
||||
* multiplayer:
|
||||
* revised maps: Silverhead Crossing, Weldyn Channel, Blue Water Province
|
||||
* the server sends a periodical 'ping' to all players to detect ghosts
|
||||
|
|
|
@ -22,10 +22,14 @@ Version 1.3.9+svn:
|
|||
* Updated translations: Czech, Danish, Finnish, French, Galician, Greek,
|
||||
Hungarian, Italian, Polish, Swedish, Valencian.
|
||||
|
||||
* map editor:
|
||||
* Fixed a bug, when two dimensions of a map were modified, the editor
|
||||
could crash.
|
||||
|
||||
* Multiplayer
|
||||
* Revised maps: Silverhead Crossing, Weldyn Channel, Blue Water Province.
|
||||
|
||||
* Uunits:
|
||||
* Units:
|
||||
* Necromancer can now be female when advanced from Dark Sorceress
|
||||
|
||||
* User interface
|
||||
|
|
|
@ -155,8 +155,12 @@ void editormap::swap_starting_position(const size_t x1, const size_t y1,
|
|||
void editormap::add_tiles_right(
|
||||
const unsigned count, const t_translation::t_letter& filler)
|
||||
{
|
||||
// We can no longer 'trust' the map stats so need to get the info from
|
||||
// the tiles_. After adding the size() will change so use a temp variable.
|
||||
const size_t size = tiles_.size();
|
||||
|
||||
for(size_t x = 1; x <= count; ++x) {
|
||||
t_translation::t_list one_row(total_height_);
|
||||
t_translation::t_list one_row(size);
|
||||
for(size_t y = 0; y < tiles_[1].size(); ++y) {
|
||||
one_row[y] =
|
||||
filler != t_translation::NONE_TERRAIN ?
|
||||
|
@ -172,8 +176,12 @@ void editormap::add_tiles_right(
|
|||
void editormap::add_tiles_left(
|
||||
const unsigned count, const t_translation::t_letter& filler)
|
||||
{
|
||||
// We can no longer 'trust' the map stats so need to get the info from
|
||||
// the tiles_. After adding the size() will change so use a temp variable.
|
||||
const size_t size = tiles_.size();
|
||||
|
||||
for(size_t i = 1; i <= count; ++i) {
|
||||
t_translation::t_list one_row(total_height_);
|
||||
t_translation::t_list one_row(size);
|
||||
for(size_t y = 0; y < tiles_[1].size(); ++y) {
|
||||
one_row[y] =
|
||||
filler != t_translation::NONE_TERRAIN ?
|
||||
|
|
|
@ -288,8 +288,6 @@ gamemap::location::DIRECTION gamemap::location::get_opposite_dir(gamemap::locati
|
|||
gamemap::gamemap(const config& cfg, const std::string& data,
|
||||
const tborder border_tiles, const tusage usage) :
|
||||
tiles_(1),
|
||||
total_width_(0),
|
||||
total_height_(0),
|
||||
terrainList_(),
|
||||
letterToTerrain_(),
|
||||
villages_(),
|
||||
|
@ -297,6 +295,8 @@ gamemap::gamemap(const config& cfg, const std::string& data,
|
|||
terrainFrequencyCache_(),
|
||||
w_(-1),
|
||||
h_(-1),
|
||||
total_width_(0),
|
||||
total_height_(0),
|
||||
border_size_(border_tiles),
|
||||
usage_(usage)
|
||||
{
|
||||
|
|
|
@ -235,10 +235,6 @@ protected:
|
|||
*/
|
||||
void clear_border_cache() { borderCache_.clear(); }
|
||||
|
||||
//! Sizes of the map including the borders.
|
||||
int total_width_;
|
||||
int total_height_;
|
||||
|
||||
private:
|
||||
int num_starting_positions() const
|
||||
{ return sizeof(startingPositions_)/sizeof(*startingPositions_); }
|
||||
|
@ -258,6 +254,10 @@ private:
|
|||
int w_;
|
||||
int h_;
|
||||
|
||||
//! Sizes of the map including the borders.
|
||||
int total_width_;
|
||||
int total_height_;
|
||||
|
||||
//! The size of the border around the map.
|
||||
int border_size_;
|
||||
//! The kind of map is being loaded.
|
||||
|
|
Loading…
Add table
Reference in a new issue