Fix a bug where the random map generator could place a keep on the border

(bug #11150).
This commit is contained in:
Mark de Wever 2008-02-26 18:40:56 +00:00
parent 80a69e7637
commit 4c6fbd5424
2 changed files with 9 additions and 4 deletions

View file

@ -18,6 +18,8 @@ Version 1.3.19+svn:
* cleanups and a compiler fix based on patch #911
* the detection of the savegame version was done after parsing the savegame
this could lead to crashes when loading 1.2 savegames (debian bug 467088)
* fix a bug where the random map generator could place a keep on the border
(bug #11150)
Version 1.3.19:
* map editor:

View file

@ -61,10 +61,13 @@ private:
void place_passage(const passage& p);
bool on_board(const gamemap::location& loc) const
{ return loc.x >= 0 && loc.y >= 0 &&
loc.x < static_cast<long>(width_) &&
loc.y < static_cast<long>(height_); }
// Note we assume a border size of 1.
bool on_board(const gamemap::location& loc) const
{
return loc.x > 0 && loc.y > 0 &&
loc.x < static_cast<long>(width_ - 1) &&
loc.y < static_cast<long>(height_ - 1);
}
void set_terrain(gamemap::location loc, t_translation::t_terrain t);
void place_castle(const std::string& side, gamemap::location loc);