Make sure all members are initialized in the constructor.
This commit is contained in:
parent
bc89d81823
commit
3da5ecb541
1 changed files with 11 additions and 2 deletions
13
src/map.cpp
13
src/map.cpp
|
@ -148,7 +148,9 @@ std::string gamemap::location::write_direction(gamemap::location::DIRECTION dir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gamemap::location::location(const config& cfg, const variable_set *variables)
|
gamemap::location::location(const config& cfg, const variable_set *variables) :
|
||||||
|
x(-1000),
|
||||||
|
y(-1000)
|
||||||
{
|
{
|
||||||
std::string xs = cfg["x"], ys = cfg["y"];
|
std::string xs = cfg["x"], ys = cfg["y"];
|
||||||
if (variables)
|
if (variables)
|
||||||
|
@ -269,7 +271,14 @@ gamemap::location::DIRECTION gamemap::location::get_opposite_dir(gamemap::locati
|
||||||
}
|
}
|
||||||
|
|
||||||
gamemap::gamemap(const config& cfg, const std::string& data) :
|
gamemap::gamemap(const config& cfg, const std::string& data) :
|
||||||
tiles_(1), w_(-1), h_(-1)
|
tiles_(1),
|
||||||
|
terrainList_(),
|
||||||
|
letterToTerrain_(),
|
||||||
|
villages_(),
|
||||||
|
borderCache_(),
|
||||||
|
terrainFrequencyCache_(),
|
||||||
|
w_(-1),
|
||||||
|
h_(-1)
|
||||||
{
|
{
|
||||||
LOG_G << "loading map: '" << data << "'\n";
|
LOG_G << "loading map: '" << data << "'\n";
|
||||||
const config::child_list& terrains = cfg.get_children("terrain");
|
const config::child_list& terrains = cfg.get_children("terrain");
|
||||||
|
|
Loading…
Add table
Reference in a new issue